> For the complete documentation index, see [llms.txt](https://help.impact.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.impact.com/brand/ja/what-would-you-like-to-learn-about/advocate-program/manage-advocate-participant-experiences/microsite-experiences/set-up-sso-for-an-impactcom-microsite-via-jwt.md).

# JWT経由でimpact.comマイクロサイトのSSOを設定する

通常、Advocateプログラムのマイクロサイトでは、顧客アドボケイトはユーザー名とパスワードで登録してから、共有リンクや報酬の詳細にアクセスします。ただし、高度な代替方法として、サーバー側で [JSON Web Token（JWT）](https://en.wikipedia.org/wiki/JSON_Web_Token) を生成し、URLパラメーターを介してマイクロサイトに渡すことで、ユーザーを認証できます。

この方法では、参加者はマイクロサイトのログイン認証情報を持ちません。代わりに、既存の顧客ポータルにログインすると、JWTを使ってユーザーを識別し、個人に合わせたコンテンツを表示するマイクロサイトへリダイレクトされます。

#### 開始する前に

{% hint style="warning" %}
**重要:** これは高度な実装方法です。マイクロサイトの標準のManaged Identity Serviceを経由せず、設定には開発チームのサポートが必要です。
{% endhint %}

次の条件すべてに当てはまる場合にのみ、この方法を使用してください。

* 参加者をプログラムのマイクロサイトに自動的にログインさせ、シングルサインオン（SSO）のような操作感を実現したい。
* サーバー側でJWTを生成できる。
* サイトに [Universal Tracking Tag（UTT）](https://help.impact.com/brand/ja/what-would-you-like-to-learn-about/platform-features/tracking/javascript-tag-tracking/tracking-with-universal-tracking-tag-utt.md) をインストールできない、またはインストールしたくない。

{% stepper %}
{% step %}

#### ステップ1: Managed Identityを使わずにマイクロサイトを作成する

マイクロサイトを作成する際は、Managed Identity Serviceをオフにし、すべてのページを「未認証」ユーザーがアクセスできるように設定する必要があります。 *ダッシュボード* ページでは、JWTを使ってユーザーを認証し、マイクロサイトを読み込みます。

<details>

<summary>マイクロサイトを作成する</summary>

まず、設定を調整して *参加者ログイン* オプションをオフにします。

1. 左側のナビゲーションメニューから ![](https://1458456015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2FGgFZ4TpepHNOLrRI2yRk%2Fimage.png?alt=media\&token=5b166f3c-f805-4aaf-b2c4-0f7e11697ec0) **\[Engage]** **→ コンテンツ**.
2. 「 *マイクロサイト* 」カードで、 **設定を編集**.
3. を選択します。新しい *マイクロサイトの設定* ページにリダイレクトされます。
4. 「 *ログイン* 」セクションで、 ![](https://1458456015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2FACIoqj1Ayhx8QzL9aqYB%2Ftoggle-off-solid%20\(1\).svg?alt=media\&token=a85366cd-4b70-41a6-83df-319f89597ede) **\[オフに切り替え]** **参加者ログイン**.
5. を選択します。 **設定を保存**.

</details>

<details>

<summary>ダッシュボードページを設定する</summary>

次に、マイクロサイトの *ダッシュボード* ページを未認証ユーザーに表示されるように設定します。その後、ページ上のコンポーネントを紹介プログラムに接続し、適切な情報が表示されるようにします。

1. サイトの *ダッシュボード* ページの設定を調整します。
   * 左側のナビゲーションメニューで、 ![](https://1458456015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2FGgFZ4TpepHNOLrRI2yRk%2Fimage.png?alt=media\&token=5b166f3c-f805-4aaf-b2c4-0f7e11697ec0) **\[Engage]** **→ コンテンツ** → **コンテンツを設定** または **コンテンツを編集**.
   * ［ *マイクロサイト* ］タブで、 **ダッシュボード** の *ログイン後のレイアウト* セクションで選択します。
   * ［ ![](https://1458456015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2FNVJihd9nYKCiCEg5tI6i%2F2a92939e8e78dd7e0c0416b1a250d5ef1d7ab0dec966fb5ed320ca62acfc06c5.svg?alt=media\&token=7cab8ce5-a26b-4057-a822-0746130d9117) **メニュー］→［設定］**.
   * ［ *許可ユーザー* ］ドロップダウンリストから、 **未認証**.
2. プログラム ID を、次のコンポーネントに追加します。 *ダッシュボード*.
   * ユーザー統計 — 表示する各ユーザー統計に ID を追加する必要があります。
   * 共有リンク
   * 紹介コード
   * ソーシャルメディアボタン — 含める各ソーシャルメディア共有ボタンに ID を追加する必要があります。
3. 右上隅で、［ **保存**.

   <div data-with-frame="true"><figure><img src="https://1458456015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2FILGfObvnj8KJZ7tCnv1N%2FScreenshot%202026-05-18%20at%2008.35.52.png?alt=media&amp;token=e25b48a9-0ec3-4410-9dc0-feb609d46d34" alt="" width="563"><figcaption></figcaption></figure></div>

エディターを使ってページやコンポーネントの設定を確認・調整する方法については、次を参照してください。 [マイクロサイトエディターの解説](https://help.impact.com/brand/ja/what-would-you-like-to-learn-about/advocate-program/manage-advocate-participant-experiences/microsite-experiences/microsite-editor-explained.md) および [マイクロサイトのレイアウトとページをカスタマイズする](https://help.impact.com/brand/ja/what-would-you-like-to-learn-about/advocate-program/manage-advocate-participant-experiences/microsite-experiences/customize-microsite-layouts-and-pages.md).

</details>

<details>

<summary>不要なページを削除する</summary>

マイクロサイトで使用しないレイアウトとページを削除します。

1. ページまたはレイアウトにカーソルを合わせます。
2. ［ ![](https://1458456015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2FMLtRUwWz0pujlfmYWOgg%2FMoreVN.svg?alt=media\&token=03a3c355-a347-4207-baf7-c44fadf6d080) **その他** **］→［削除］**.
3. 次のレイアウトを削除します。 *ログイン後のレイアウト*.
4. 次のページを削除します。
   * プロフィールを編集
   * メールアドレスの確認
   * パスワードを忘れた場合
   * ログイン
   * ログアウト
   * 登録
   * パスワードをリセット
   * メールアドレスを確認

</details>
{% endstep %}

{% step %}

#### ステップ 2：JWT を生成する

JWT の構造は、ユーザー認証に関する Advocate の標準要件に準拠しています。以前に Advocate を統合したことがある場合は、UTT 用に同様のトークンをすでに生成している可能性があります。

JWT は、サーバーまたは信頼できるバックエンドシステムで安全に生成する必要があります。ブラウザーでは決して生成しないでください。

JWT の [生成方法とペイロードの要件](https://integrations.impact.com/integration-guides/for-brands/advocate/advocate-tracking-integrations/json-web-tokens-jwts).
{% endstep %}

{% step %}

#### ステップ 3：JWT をマイクロサイトの URL に追加する

ユーザーがプラットフォームにログインしたら、URL のクエリ文字列に JWT を含めてマイクロサイトにリダイレクトします。

{% hint style="info" %}
**例：** `https://your-microsite.squatch.app/?jwt=<YOUR_GENERATED_JWT>`
{% endhint %}

マイクロサイトは、新しいブラウザータブで開くことも、iframeを使ってアプリに埋め込むこともできます。マイクロサイトを埋め込む場合は、次の点を適切に処理してください。 [クロスオリジンリソース共有（CORS）](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) およびブラウザーの制限。
{% endstep %}
{% endstepper %}

#### メモ

* この認証方式を使用すると、ユーザーはマイクロサイトにログインするための認証情報を持ちません。
* JWTベースのアクセスは厳重に管理する必要があります。クライアント側のJavaScriptでJWTを公開したり、操作したりしないでください。
* これは標準的な方法ではありません。プログラムを公開する前に、ステージング環境で十分にテストしてください。
* サポートが [必要な](mailto:saasquatch-support@impact.com)場合は、サポートへのお問い合わせに、マイクロサイトのURL、実装の詳細、JWTペイロードのサンプルを含めてください。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.impact.com/brand/ja/what-would-you-like-to-learn-about/advocate-program/manage-advocate-participant-experiences/microsite-experiences/set-up-sso-for-an-impactcom-microsite-via-jwt.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
