> 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/zh/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 令牌（JWT）](https://en.wikipedia.org/wiki/JSON_Web_Token) 服务器端，并通过 URL 参数将其传递给微站点。

使用这种方法，参与者将不会拥有微站点的登录凭据。相反，他们通过登录您现有的客户门户来获得访问权限，然后系统会使用 JWT 将他们重定向到微站点，以识别其身份并显示其个性化内容。

#### 开始前

{% hint style="warning" %}
**重要：** 这是一个高级实现方案，它绕过了微站点的标准受管身份服务，并且需要开发团队的支持来进行设置。
{% endhint %}

仅当以下所有条件都适用时，您才应使用此方法：

* 您希望通过自动将参与者登录到您计划的微站点来模拟单点登录（SSO）体验。
* 您可以在服务器端生成 JWT。
* 您无法或不想安装 [通用跟踪标签（UTT）](/brand/zh/what-would-you-like-to-learn-about/platform-features/tracking/javascript-tag-tracking/tracking-with-universal-tracking-tag-utt.md) 到您的站点上。

{% stepper %}
{% step %}

#### 步骤 1：创建一个不使用受管身份的微站点

当您创建微站点时，您需要关闭受管身份服务，然后将所有页面设置为“未验证”用户可访问。该 *仪表板* 页面将使用 JWT 对用户进行身份验证并加载微站点。

<details>

<summary>创建微站点</summary>

首先，调整设置以关闭 *参与者登录* 选项。

1. 从左侧导航菜单中，选择 ![](https://1186853034-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://1186853034-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://1186853034-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://1186853034-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://1186853034-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>

如需使用编辑器查找并调整页面和组件设置的帮助，请参阅 [微型站点编辑器说明](/brand/zh/what-would-you-like-to-learn-about/advocate-program/manage-advocate-participant-experiences/microsite-experiences/microsite-editor-explained.md) 和 [自定义微站点布局和页面](/brand/zh/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://1186853034-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 中暴露或操作它。
* 这是一种非标准方法——在发布您的计划之前，请先在预发布环境中进行充分测试。
* 如果您需要 [支持](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/zh/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.
