> For the complete documentation index, see [llms.txt](https://developers-apps-in-toss.toss.im/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers-apps-in-toss.toss.im/guide/zh/authentication/user-info.md).

# 关联用户信息

即使用户无需亲自输入，也能从 Toss 安全地调取所需信息。比如寄快递时，用户无需逐一输入姓名、手机号、地址等，经过同意后即可直接调取已保存在 Toss 中的信息。

{% hint style="info" %}
**请务必确认**

* 用户信息获取 **是与 Toss 登录分开的功能**。即使不登录 Toss 也可以使用。
* 向用户 **个人信息向第三方提供同意**后才会传递信息。
* 曝光时点最多 **5个**可注册。
* 可在无需单独服务器的情况下使用，SDK **v2.7.0** 以上可使用。
  {% endhint %}

***

### 1. 进入用户信息获取

请在控制台中进入用户信息获取菜单。

* **进入方法：** App in Toss 控制台 → 选择工作区 → 选择迷你应用 → 左侧菜单 **“获取用户信息”**

首次进入时，会显示尚未注册信息的空白页面。 `注册` 按钮开始设置。

<figure><img src="/files/49a1a53abe9012585b2886b2ffa2f8b6499af973" alt=""><figcaption></figcaption></figure>

***

### 2. 设置同意文曝光时点

设置向用户请求信息提供同意的时点。请根据服务中需要用户信息的场景撰写标题。

<figure><img src="/files/c591ffe44c667318a89f22219a6002a2258045b2" alt=""><figcaption></figcaption></figure>

**同意界面标题**

这是显示在同意界面上的标题。在输入的文本后面 **“要获取所需的信息吗？”** 会自动添加。例如 `寄快递`输入“寄快递”后，向用户 **“要获取寄快递时所需的信息吗？”** 显示。

**要获取的用户信息**

请选择在该时点要获取的用户信息。可选择的项目如下。用户信息会获取 Toss App → 设置 → 我的信息 · 地址管理中的信息。

| 项目      | 说明         | 备注                                    |
| ------- | ---------- | ------------------------------------- |
| 姓名      | 用户姓名       |                                       |
| 性别      | 用户性别       |                                       |
| 本国人/外国人 | 是否为本国人/外国人 |                                       |
| 出生日期    | 用户出生日期     |                                       |
| 手机号码    | 用户手机号码     |                                       |
| 地址      | 用户家庭地址     | 由于注册 Toss 时并非必填，可能没有值，这种情况下会传递为 null。 |
| 电子邮件地址  | 用户电子邮件地址   | 由于注册 Toss 时并非必填，可能没有值，这种情况下会传递为 null。 |

**添加曝光时点**

如果服务中需要用户信息的时点有多个， `添加曝光时点` 可用按钮添加时点。最多 **5个**可注册。可为每个时点设置不同的要获取的用户信息。比如在发快递时可请求姓名·手机号·地址，在身份验证时可只请求姓名·出生日期。

***

### 3. 确认同意文内容

向用户展示的同意文会以 **个人信息向第三方提供同意** 格式自动生成。会根据所选用户信息项自动构成同意文内容。 `查看` 按钮可预览整个同意文内容。

***

### 4. 设置回调（可选）

当用户在迷你应用中注销会员时，注销事件会发送到已注册的回调 URL。收到事件后，请销毁该用户的信息。

{% hint style="info" %}
回调为可选项。若要使用回调，请将开关设为 **ON**。
{% endhint %}

**回调 URL**

请输入接收注销事件的 URL。

**HTTP 方法**

回调调用时使用的 HTTP 方法 **GET** 或 **POST** 中请选择。

**Basic Auth 标头**

这是回调请求时包含在 HTTP 标头中的认证信息。 `Authorization: Basic {输入的值}` 的形式传递。

**回调测试**

在保存设置之前， `测试` 请通过按钮确认回调是否正常工作。必须测试成功后才能保存。

***

### 5. 完成注册并复制代码

注册完成后，每个曝光时点都会 `cud_`开头的唯一代码（`consentedUserDataKey`）会生成。这个代码用于在 SDK 中获取用户信息。请点击复制图标复制代码。

注册后，可在同意文信息界面一眼查看曝光时点、要获取的用户信息、代码。 `修改` 按钮可更改设置。

<figure><img src="/files/3e27a8b932aaf254d237b7564a134d694432cd95" alt=""><figcaption></figcaption></figure>

***

### 6. 撤销

已同意的同意文可在以下路径撤销。可单独撤销。

* **撤销方法：** Toss App → 设置 → 服务条款及个人信息处理同意 → 迷你应用名称

***

### 开发对接

> 用户信息 >
>
> 可通过 SDK 获取用户信息。


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers-apps-in-toss.toss.im/guide/zh/authentication/user-info.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
