> 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. 进入用户信息获取

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

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

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

<figure><img src="https://1415110023-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8pQgXiR5QAzduV54W8Om%2Fuploads%2FTBWJatnPeGEq7cv43iZJ%2Fimage.png?alt=media&amp;token=c805ab45-a2f4-4878-97b1-a4cf27f31177" alt=""><figcaption></figcaption></figure>

***

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

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

<figure><img src="https://1415110023-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8pQgXiR5QAzduV54W8Om%2Fuploads%2Ff2LwHsTh2KgH4O8fJp5x%2Fimage.png?alt=media&amp;token=deae4793-1f74-47c8-83e8-9a4ab65b5bc2" alt=""><figcaption></figcaption></figure>

**同意界面标题**

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

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

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

| 项目      | 说明         | 备注                                   |
| ------- | ---------- | ------------------------------------ |
| 姓名      | 用户姓名       |                                      |
| 性别      | 用户性别       |                                      |
| 本国人/外国人 | 是否为本国人/外国人 |                                      |
| 出生日期    | 用户出生日期     |                                      |
| 手机号码    | 用户手机号码     |                                      |
| 地址      | 用户家庭住址     | 注册 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="https://1415110023-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8pQgXiR5QAzduV54W8Om%2Fuploads%2Fr9BS6jzrZqXAjZq7pe88%2Fimage.png?alt=media&amp;token=46c22019-2e51-4893-b512-5da6b89c0530" alt=""><figcaption></figcaption></figure>

***

### 6. 取消授权

已同意的同意文案可在以下路径取消授权。可单独取消授权。

* **取消授权方法：** Toss 应用 → 设置 → 条款及个人信息处理同意 → 迷你应用名称

***

### 开发对接

> [用户信息 >](/documentation/api-and-sdk-zh/sdk/domains-api/user/user.getconsenteddata.md)
>
> 可通过 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.
