-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathauthentication-openapi.json
1 lines (1 loc) · 638 KB
/
authentication-openapi.json
1
{"openapi":"3.0.0","info":{"title":"Authing 用户认证 API","description":"\n\n[Authing](https://authing.co/) 是一款国内领先的、基于云原生架构的 IDaaS 产品,兼容 OAuth 2.0, OIDC, SAML, AD/LDAP, WS-Fed 等所有主流认证 / 授权协议,可以帮助你快速实现任何 Web、App 和企业软件的身份认证和用户管理,为你的客户和员工提供安全且完善的登录解决方案。\n\n<img src=\"https://files.authing.co/api-explorer/what-is-authing.jpg\" alt=\"drawing\"/> \n","version":"3.0","contact":{},"x-logo":{"url":"https://files.authing.co/authing-logo.png","href":"https://authing.co","altText":"Authing Website"},"x-servers":[{"url":"https://your_domain.authing.cn","description":"你的应用域名"}],"x-meta":{"title":"Authing 用户认证 API(V3)","description":"Authing 是一款国内领先的、基于云原生架构的 IDaaS 产品,兼容 OAuth 2.0、OIDC、SAML、AD/LDAP、WS-Fed 等所有主流认证 / 授权协议,可以帮助你快速实现任何 Web、App 和企业软件的身份认证和用户管理,为你的客户和员工提供安全且完善的登录解决方案。","keywords":"Documentation, Authing, IDaaS, OIDC, OAuth, 微信, 社会化登录","image":"https://authing.co/favicon.ico"}},"tags":[{"name":"开发准备/基本概念","description":"在你正式进入开发前,需要先了解一下 Authing 几个最核心的概念。\n\n## 用户池\n\n**用户池**是 Authing 租户与租户之间的隔离单位,你拥有的所有用户数据、应用、资源等,都在一个**用户池**下。如果你还没有注册 Authing 账号,或者还未创建**用户池**,请先前往 [https://authing.co/](https://authing.co/) 创建你的第一个**用户池**。\n\n## 应用\n\nAuthing 中的**应用**对应了你实际开发的应用,比如当你要基于 Authing 开发一个商城 APP 的时候,你在 Authing 的用户池中也会创建一个对应的应用。**每个应用有自己的应用 ID、应用密钥和二级域名**,当你需要调用此部分的 API 时,你会需要用到他们。\n\n## 外部身份源\n\n**外部身份源**(又称身份提供商,英文全称为 Identity Provider,简称 IdP)指的是一个负责收集、存储用户身份信息,如用户名、密码等,在用户登录时负责认证用户的第三方,比如我们经常使用**微信社会化登录**、**Google 社会化登录**等。使用外部身份源可以降低开发者等维护成本以及终端用户的使用成本。\n\n在 Authing 中,我们将身份提供商分为以下几种:\n\n- [社会化身份源](https://docs.authing.cn/v2/guides/connections/social.html):如微信、支付宝、GitHub、Apple 这类面向所有公众开放的第三方应用。\n- [企业身份源](https://docs.authing.cn/v2/guides/connections/enterprise.html):企业微信、钉钉、飞书、WeLink 这类一般面向于单个公司内部开放的应用,以及其他以 Windows AD、OIDC、SAML、LDAP、CAS、OAuth2.0 等标准协议对外提供服务的第三方应用。\n- [自定义数据库](https://docs.authing.cn/v2/guides/database-connection/overview.html):采用配置自定义数据库连接和脚本的方式,将用户数据存储到你自己的数据库,Authing 将不再存储你的用户数据。\n\n## 外部身份源连接\n\n一个外部身份源,对外可能会暴露多种**连接方式**。就像微信,作为一个外部身份源,它会有微信 PC 扫码登录、PC 小程序扫码登录、小程序登录、移动端微信登录、公众号关注登录、微信网页授权等多种登录方式;再比如 Apple,也分为 Apple 移动端登录和 Apple Web 端登录。\n\n对于终端用户而言,不同的连接方式对应了在不同场景下的不同登录手段。但是对于一个终端用户,不同登录方式背后的身份是同一个。就好比用户使用微信登录你开发的 Web 应用时,可以采用微信 PC 扫码登录这种登录方式,而当要使用微信 APP 登录你的移动应用时,可以采用微信移动端登录这种登录方式,但是他们本质上都是使用一个身份进行登录。\n\n对于开发者而言,只需要关心在什么场景下需要给用户呈现哪种登录方式,至于如何将使用不同连接方式登录的终端用户识别为同一个账号,Authing 的认证引擎会为你省去这些繁琐的工作。\n\n根据连接方式的不同,不同类型的身份源连接方式在用户使用形式、接入方式上也存在差异。大致上可以分为三类:\n\n- **Web 端浏览器跳转类**:需要浏览器跳转到第三方身份源的登录页,用户完成授权之后,再回到当前页面。此类可以通过直接替换当前页面地址和弹出 Popup 窗口实现。例如微信 PC 扫码登录、Google 社会化登录等。\n- **Web 端内嵌二维码扫码登录类**:和「Web 端浏览器跳转类」不同,此类连接方式不需要浏览器跳转,而是让用户在移动端 APP 上扫码,浏览器采用二维码轮询的方式监听登录态。例如微信公众号关注登录和 Authing 自创的小程序扫码登录。\n- **移动端拉起第三方应用类**:在移动 APP 中,跳转到第三方身份源的 APP,用户完成授权之后,再回到当前 APP。例如在移动 APP 中使用微信、支付宝登录。\n\n针对以上这三种场景,我们都提供了对应的 API,帮助你实现快速接入你想要的外部身份源登录。\n","x-displayName":"基本概念"},{"name":"开发准备/HTTP 请求","description":"## API 端点\n\nAuthing API(V3) Root 端点为:[https://\\<YOUR_DOMAIN\\>.authing.cn](#) (需要将 `YOUR_DOMAIN` 替换为你自己的应用域名)。\n\n所有接口均通过 HTTPS 加密传输,如非特殊标记,请求参数和返回数据均通过 `application.json` 格式传递。\n\n> 如果是私有化部署的 Authing 服务,API 端点信息请联系你的客户经理获取。\n\n## HTTP 请求动词\n\nAuthing API(V3) 目前使用到了两种 HTTP 动词:\n\n| HTTP 请求动词 | 描述 |\n| ------------- | -------------------------- |\n| GET | 用于获取资源。 |\n| POST | 用于创建、修改、删除资源。 |\n\n## HTTP 路径\n\nAuthing API(V3) 接口一般遵循 `/api/v3/verb` 的接口命名规范,`verb` 如果包含多个单词,使用 `-` 隔开,如:\n\n- 使用用户凭证登录:`/api/v3/signin`\n- 绑定邮箱:`/api/v3/bind-email`\n\n## HTTP 请求头\n\n**调用 Authing 用户认证 API(V3) 时必须携带以下请求头**:\n\n| 请求头 | 是否必填 | 含义 |\n| ---------------- | -------- | --------------------------------------------------------------------------------------------- |\n| content-type | 是 | 如接口未特殊说明,请填 `application/json` |\n| x-authing-app-id | 是 | Authing 应用 ID。 |\n| authorization | 否 | 用户的 `access_token`,当用户登录之后可以获取。要求具备用户登录态才能访问的接口必填。 |\n\n**调用 Authing 管理 API(V3) 时必须携带以下请求头**:\n\n| 请求头 | 是否必填 | 含义 |\n| ---------------- | -------- | --------------------------------------------------------------------------------------------- |\n| x-authing-userpool-id | 是 | Authing 用户池 ID |\n| authorization | 是 | 使用 `Access Key ID` 和 `Access Key Secret` 对请求上下文的签名,详情见[鉴权机制](#tag/开发准备/鉴权机制)。 |\n\n## HTTP 重定向\n\n在某些情况下,Authing API(V3) 接口会返回一个 **HTTP 重定向** 的响应,重定向的内容将会放在 **Response Header** 的 `Location` 字段上。\n\n## 分页请求\n\n默认情况下,分页接口默认一页会返回 10 个元素,并且如果无特殊说明,每页最大值为 50 个,你可以通过 `page` 和 `limit` 参数指定对应的页码和每页包含的元素个数。示例:\n\n```bash\ncurl 'https://<YOUR_DOMAIN>.authing.cn/api/v3/get-login-history?page=2&limit=50'\n```\n\n## HTTP 响应结构\n\n如非接口特殊声明,Authing 用户认证 API(V3) 的响应体格式如下:\n\n```json\n{\n \"statusCode\": <STATUS_CODE>,\n \"apiCode\": <API_CODE>,\n \"message\": <ERROR_MESSAGE>, // 错误描述信息\n \"data\": <RESPONSE_DATA>, // 具体响应数据\n}\n```\n\nAuthing 管理 API(V3) 的响应体格式如下:\n\n```json\n{\n \"statusCode\": <STATUS_CODE>,\n \"apiCode\": <API_CODE>, // 详细错误类型,当请求失败时会返回\n \"message\": <ERROR_MESSAGE>, // 错误描述信息\n \"requestId\": <REQUEST_ID>, // 错误请求 ID,当请求失败时会返回\n \"data\": <RESPONSE_DATA>, // 具体响应数据\n}\n```\n\n`statusCode` 和 `apiCode` 的具体描述和错误处理方式见[错误处理](#tag/开发准备/错误处理)。\n","x-displayName":"HTTP 请求"},{"name":"开发准备/配置安全域","description":"默认情况下,Authing 不会校验 API 请求来源,你可以在 Authing 控制台中的**安全设置 - 基础安全 - 配置安全域(CORS)**,如果有多个域名,可以通过换行符(`\\n`)进行分割。配置之后,只有在你安全域配置白名单中的域,才能调用相关 API。\n\n<img src=\"https://files.authing.co/api-explorer/9d0b6685-dfdb-4c38-9812-1e732a5c1b82.png\" alt=\"drawing\"/>\n","x-displayName":"配置安全域"},{"name":"开发准备/鉴权机制","description":"<!-- Authing 管理 API(V3) 使用的是 AK/SK 本地对请求数据的摘要进行签名的鉴权机制,客户端在调用 API 时,需要使用 SK 对请求数据的摘要进行签名计算,并将签名结果传输给服务器端进行签名验证。\n\n## 为什么使用 AK/SK 签名的方式\n\nAuthing 管理 API(V3) 使用 AK/SK 本地签名的鉴权机制,主要从以下几点安全性进行考虑:\n\n1. 验证客户端的合法性\n2. 防止请求数据在网络传输过程中被篡改\n3. 在请求数据中加入时间戳元素,防止[重放攻击](https://zh.wikipedia.org/wiki/%E9%87%8D%E6%94%BE%E6%94%BB%E5%87%BB)\n\n## 如何查看我的 AK/SK\n\n在 Authing 中,目前有两种类型的 AK/SK:\n\n- 用户池全局 AK/SK:具备用户池内所有资源的全局操作权限。你可以在 [Authing 控制台](https://console.authing.cn) 的**设置** - **基础设置** - **密钥管理** 获取到**用户池 ID** 和**用户池密钥**,其中**用户池 ID**为 AK(Access Key ID),**用户池密钥**为 SK(Access Key Secret)。\n- 协作管理员 AK/SK:可针对用户池内的资源进行细粒度授权,协作管理员的 AK/SK 只能调用其被授权的 API。\n\n## 摘要签名机制原理说明\n\n拿到了你的 AK/SK 之后,下面我们来看如何使用 AK/SK 对一次 API 请求进行签名。\n\n### 将请求数据生成摘要\n\n假设在不考虑任何签名机制的情况下,我们有一个原始的获取用户列表的请求,如下所示:\n\n```\ncurl --request POST \\\n --url https://api.authing.cn/api/v3/list-users \\\n --header 'content-type: application/json' \\\n --header 'some-other-header: some-random-value' \\\n --data '{\n \"options\": {\n \"pagination\": {\n \"page\": 1,\n \"limit\": 10\n }\n }\n}'\n```\n\nHTTP 请求数据如下:\n\n- 请求方式:`POST`;\n- 请求 API URL:`/api/v3/list-users`,不带域名和 Query 参数;\n- 请求头:携带了两个请求头 `content-type: application/json;charset=utf-8` 和 `some-other-header: some-random-value`;\n- 请求体:在请求体中传递了一个对象。\n\n在此基础上添加上 Authing API 签名要求的必要**请求头**:\n\n- `date` 请求头:客户端请求时刻的时间,为标准 GMT 格式,如 `Wed, 21 Oct 2015 07:28:00 GMT`,详情见 [Http date header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Date);\n- `x-authing-signature-nonce`: 签名随机字符串;\n- `x-authing-signature-method`: 签名算法,目前仅支持 `HMAC-SHA1`;\n- `x-authing-signature-version`: 签名算法版本,目前为 `1.0`。\n\n```text{1-10}\ncurl --request POST \\\n --url https://api.authing.cn/api/v3/list-users \\\n --header 'content-type: application/json;charset=utf-8' \\\n --header 'some-other-header: some-random-value' \\\n --header 'date: Sun, 09 Oct 2022 06:14:00 GMT'' \\\n --header 'x-authing-signature-nonce: f02a938cdbcf1b1f10bf14887eda6659' \\\n --header 'x-authing-signature-method: HMAC-SHA1' \\\n --header 'x-authing-signature-version: 1.0' \\\n --data '{\n \"options\": {\n \"pagination\": {\n \"page\": 1,\n \"limit\": 10\n }\n }\n}'\n```\n\n在此之后,我们将上述的请求数据转换成下面这种格式的字符串:\n\n```\nHTTP-Verb\nContent-Type\nDate\nCanonicalizedAuthingHeaders\nCanonicalizedResource\n```\n\n其中每一项的释义如下:\n\n- `HTTP-Verb`: HTTP 请求动词,在这个例子里,为 `POST`;\n- `Content-Type`: HTTP 请求数据格式,在这个例子里,为 `application/json;charset=utf-8`\n- `Date`: 客户端请求时刻的时间,为标准 GMT 格式,如 `Wed, 21 Oct 2015 07:28:00 GMT`,详情见 [Http date header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Date);在这个例子里,为 `Sun, 09 Oct 2022 06:14:00 GMT`;\n- `CanonicalizedAuthingHeaders`: 经过规范化处理的 Authing 相关请求头,下面会介绍如何拼接;\n- `CanonicalizedResource`: 经过规范化处理的 API 资源,下面会介绍如何拼接;\n\n于是我们得到:\n\n```\nPOST\napplication/json;charset=utf-8\nWed, 21 Oct 2015 07:28:00 GMT\nCanonicalizedAuthingHeaders\nCanonicalizedResource\n```\n\n下面我们再分别介绍 CanonicalizedAuthingHeaders 和 CanonicalizedResource 的构建过程。\n\n#### 构建 CanonicalizedAuthingHeaders 参数\n\nCanonicalizedAuthingHeaders 的构建过程如下:\n\n1. 只需包含以 `x-authing-` 开头的请求头。\n2. 需要将每个 HTTP 标头名称转换为小写。例如,将 `X-Authing-Signature-Method` 转换为 `x-authing-signature-method`。\n3. 需要根据请求头名称按**字典顺序**进行排序。例如,`x-authing-signature-method` 应该在 `x-authing-signature-nonce` 之前。\n4. 每个请求头按照 `key=value` 的格式进行拼接,`key` 和 `value` 之间不应该包含空格。\n5. 不同的请求头之间通过换行符号(`\\n`)分隔。\n\n于是得到如下结果:\n\n```\nPOST\napplication/json;charset=utf-8\nWed, 21 Oct 2015 07:28:00 GMT\nx-authing-signature-method:HMAC-SHA1\nx-authing-signature-nonce:11223344\nx-authing-signature-version:1.0\nCanonicalizedResource\n```\n\n#### 构建 CanonicalizedResource 参数\n\nCanonicalizedResource 的构建过程如下:\n\n1. 不管是 `GET` 请求还是 `POST` 请求,格式需遵循 `<API_URL>?<API_DATA>`,中间使用 `?` 分隔。\n2. `<API_URL>` 部分不应该包含域名和 Query 和 Query 参数。例如:`https://api.authing.cn/api/v3/list-users?a=b` 这个请求,只保留 `/api/v3/list-users` 部分。\n3. `<API_DATA>` 部分规则如下:\n\n- 如果是 `GET` 请求,使用 Query 中的查询参数作为 `<API_DATA>` 需要的数据;\n- 如果是 `POST` 请求,使用 Body 中的请求体作为 `<API_DATA>` 需要的数据。\n\n遍历`<API_DATA>` 需要的数据的每一个 key,将此 key 和这个 key 对应的 value 按照 `key=value` 的方式进行拼接(如果 value 为字符串、数字、布尔值等原始值,无需做额外处理;如果 value 是一个对象,需要先转换成 JSON 字符串再[编吗为 URL 格式](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI))。不同的 key/value 对之间使用 `&` 符号进行连接。\n\n于是我们再得到如下结果:\n\n```\nPOST\napplication/json;charset=utf-8\nWed, 21 Oct 2015 07:28:00 GMT\nx-authing-signature-method:HMAC-SHA1\nx-authing-signature-nonce:11223344\nx-authing-signature-version:1.0\n/api/v3/list-users?options=%7B%22pagination%22:%7B%22page%22:1,%22limit%22:10%7D%7D\n```\n\n下文中我们会将这个最终得到的字符串叫做 `stringToSign`。\n\n### 将生成的摘要使用 SK 计算签名\n\nAuthing API 的签名鉴权机制使用 `HMAC-SHA1` 算法,并生成 `base64` 格式的摘要。\n\n以 `Node.js` 代码为例:\n\n```js\nexport function buildSignature(accessKeySecret: string, stringToSign: string) {\n return crypto\n .createHmac('sha1', accessKeySecret)\n .update(Buffer.from(stringToSign, 'utf8'))\n .digest('base64');\n}\n```\n\n于是我们再得到类似下面的结果:\n\n```\nPFboTzV5F7WjU4yKCFmcRDTZ6tk=\n```\n\n### 根据 AK/SK + 签名构建 Authorization 请求头\n\n得到了签名之后,我们按照如下格式拼接 `Authorization` 请求头的内容:\n\n```\nauthing <accessKeyId>:<signature>\n```\n\n于是我们得到最终的结果:\n\n```\nauthing 62eaa95ffxxxxee52ae6b90c:PFboTzV5F7WjU4yKCFmcRDTZ6tk=\n```\n\n我们需要将其放到 `Authorization` 中并传输给 Authing 服务器。\n\n### 发出最终请求\n\n```text{1-10}\ncurl --request POST \\\n --url https://api.authing.cn/api/v3/list-users \\\n --header 'content-type: application/json;charset=utf-8' \\\n --header 'some-other-header: some-random-value' \\\n --header 'date: Sun, 09 Oct 2022 06:14:00 GMT'' \\\n --header 'x-authing-signature-nonce: f02a938cdbcf1b1f10bf14887eda6659' \\\n --header 'x-authing-signature-method: HMAC-SHA1' \\\n --header 'x-authing-signature-version: 1.0' \\\n --header 'authorization: authing 62eaa95ffxxxxee52ae6b90c:PFboTzV5F7WjU4yKCFmcRDTZ6tk=' \\\n --data '{\n \"options\": {\n \"pagination\": {\n \"page\": 1,\n \"limit\": 10\n }\n }\n}'\n```\n\n## 摘要算法示例代码\n\n你可以在此查看不同语言的摘要示例代码。\n\n## 使用 SDK 请求 API\n\n我们为开发中提供了不同语言的 SDK,SDK 内置了相关签名逻辑,使得你需要过多考虑这些 -->\n\nAuthing 管理 API(V3) 通过 AK/SK 获取 `access_token` 的方式对接口进行鉴权,获取到 `access_token` 之后,你需要将其设置到 HTTP 的 `authorization` 请求头中,如下所示:\n\n```bash\ncurl -XPOST 'https://api.authing.cn/api/v3/list-users' \\\n -H 'authorization: <替换成真实的 access_token>' \\\n -H 'x-authing-userpool-id: <替换成真实的用户池 ID>'\n```\n\n详情请见[获取 access_token](#tag/鉴权机制/获取%20Access%20Token/operation/V3ManagementController_getManagementToken)。\n","x-displayName":"鉴权机制"},{"name":"开发准备/密码安全传输","description":"## HTTPS 加密传输\n\nAuthing 所有 API 均通过 HTTPS 协议对密码进行安全传输,可以在一定程度上保证安全性。如果你还需要更高级别的安全性,我们还支持 `RSA256` 和[国密 SM2](https://baike.baidu.com/item/SM2/15081831) 两种方式对密码进行加密。\n\n## RSA256\n\nAuthing 支持使用 RSA256 非对称加密方式对密码进行安全传输,你需要使用 Authing 的 RSA 公钥对密码进行加密,发送到 Authing 服务器后端之后,Authing 服务器会使用私钥进行解密。\n\nAuthing 的 RSA 公钥如下,你也可以通过此[端点](#tag/公开信息端点/API%20列表/operation/PublicAPIV3Controller_getSystemInfo)拉取:\n\n```\n-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC4xKeUgQ+Aoz7TLfAfs9+paePb\n5KIofVthEopwrXFkp8OCeocaTHt9ICjTT2QeJh6cZaDaArfZ873GPUn00eOIZ7Ae\n+TiA2BKHbCvloW3w5Lnqm70iSsUi5Fmu9/2+68GZRH9L7Mlh8cFksCicW2Y2W2uM\nGKl64GDcIq3au+aqJQIDAQAB\n-----END PUBLIC KEY-----\n\n```\n\n你可以参考[此 Demo](https://github.com/Authing/password-encryption),其包含了使用 RSA256 加密密码的示例。\n\n如果你只是简单调试,可以使用[此在线调试工具](http://www.metools.info/code/c81.html)使用上面的公钥对密码进行加密。\n\n## 国密 SM2\n\nAuthing 支持使用国密 SM2 加密方式对密码进行安全传输,你需要使用 Authing 的 SM2 公钥对密码进行加密,发送到 Authing 服务器后端之后,Authing 服务器会使用私钥进行解密。\n\nAuthing 的 SM2 公钥如下,你也可以通过此[端点](#tag/公开信息端点/API%20列表/operation/PublicAPIV3Controller_getSystemInfo)拉取:\n\n```\n042bc07187cc3bdcfe63b37902eead6dc400734d386e8e2be05d26159bce3259ae602c608052204079e5f49c12ef3296df8ceeff6314b45e2cf110dd58e96a47e4\n```\n\n你可以参考[此 Demo](https://github.com/Authing/password-encryption),其包含了使用 SM2 加密密码的示例。\n\n如果你只是简单调试,可以使用[此在线调试工具](http://www.lzltool.com/SM2)使用上面的公钥对密码进行加密。\n","x-displayName":"密码安全传输"},{"name":"开发准备/接口限流","description":"针对免费账户,Authing 默认的接口限流频率为 300 QPS / 用户池。如果触发了我们的 QPS 限制,你将收到以下错误提示:HTTP code 为 `429`,响应体为:\n\n```json\n{\n \"statusCode\": 429,\n \"message\": \"您的请求已超过最大数量限制,请稍后重试\"\n}\n```\n\n> 如果你触发了接口限流阈值,请升级套餐并联系 Authing 客服申请更大的 QPS 限制。\n","x-displayName":"接口限流"},{"name":"开发准备/服务对外 IP","description":"当你进行配置自定义数据库、接收 Webhook 通知等操作时,你可能需要获取 Authing 服务的对外 IP,并修改防火墙配置。Authing 服务的对外 IP 可以通过[此端点](#tag/公开信息端点/API%20列表/operation/PublicAPIV3Controller_getSystemInfo)获取。\n","x-displayName":"服务对外 IP"},{"name":"开发准备/错误处理","description":"Authing API(V3) 采取了和标准 RESTful API 不完全一致的错误处理方案,如果没有特殊说明,\n所有接口返回的 HTTP 状态码均为 `200`。一个 HTTP 状态码为 `200` 的响应,不能视为操作成功,你需要通过响应体的具体内容进行判断。\n\nAuthing API(V3) 接口响应体中,包含了两个状态码:`statusCode` 和 `apiCode`:\n\n- `statusCode`: `statusCode` 为请求状态码,不包含具体的业务错误信息。**当且仅当 `statusCode` 为 `200` 时,表示接口请求成功**,此时不会带有 `apiCode`。`statusCode` 不为 `200` 的情况下,\n 表示接口请求失败或者需要进行额外操作(比如登录接口需要进行 MFA 二次验证),你需要对此进行关注,进行必要的错误处理。每个 `statusCode` 对应一个类型的错误,\n 具体的错误分类请见下文。在大多数情况下,除非你需要对某些特定的异常做出响应,否则你只需要关注 `statusCode`,不需要关注 `apiCode`。\n- `apiCode`: `apiCode` 为业务状态码,每个 `apiCode` 具备特定的错误含义,具体的 `apiCode` 列表见下文。`apiCode` 只会在 `statusCode` 非 200 且错误原因具备业务含义时才会返回。\n\n## statusCode\n\n| 错误码大类 | 错误类型 | 包含详细错误码 |\n| ---------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| 2xx | 请求正常 | - 200: OK |\n| 4xx | 客户端异常 | - [400]InvalidArgumentError:请求参数格式错误 <br> - [401]UnauthorizedError:用户未登录 <br>- [402]PaymentNeededError:此接口需要升级套餐之后使用<br>- [403]ForbiddenError:没有权限执行某操作<br>- [404]NotFoundError:找不到资源<br>- [409]ConflictError:要创建的资源和已有资源存在字段冲突<br>- [413]PayloadTooLargeError:请求体过大<br>- [422]InvalidOperationError:非法操作(参数格式正确,但不符合业务限制)<br>- [429]ThrottleError:触发限流机制<br>- [499]ClientError:通用客户端异常 |\n| 5xx | 服务器端异常 | - [500]ServerError:通用服务端异常<br>- [501]UnsupportedOperationError:服务器不支持的操作<br> - [502]BadGatewayError:微服务调用出错<br> - [503]ServiceUnavailableError:维护中 |\n| 6xx | 第三方服务调用异常 | - [601]EndpointRequestError:请求第三方端点失败<br>- [602]EndpointResponseError:第三方端点返回了错误<br>- [603]CustomCodeError:自定义代码出错,例如 pipeline 或自定义数据库 |\n\n## apiCode\n\n| apiCode | 描述 |\n| :------ | :--------------------------------------------------------- |\n| 1300 | AK/SK 签名不合法 |\n| 1301 | AK/SK 签名方式和服务端不匹配 |\n| 1302 | AK/SK 签名版本和服务端不匹配 |\n| 1303 | AK/SK 签名时间戳格式不正确,应该是单位为毫秒的 Unix 时间戳 |\n| 1304 | 使用 AK/SK 签名机制时,请求头中没有 date 请求头 |\n| 1305 | AK/SK 签名时间戳和服务器时间戳相差较大,此次请求不被允许 |\n| 1306 | AK/SK 签名已经被消费过,此次请求不被允许 |\n| 1600 | 认证后流程成功完成,登录态已设置 |\n| 1635 | 个人(个人中心绑定)MFA |\n| 1636 | 企业(应用下配置的) MFA |\n| 1639 | 首次登录重置密码(不需要验证旧密码) |\n| 1640 | 触发联邦认证询问身份绑定,只允许绑定现有账号 |\n| 1641 | 触发联邦认证询问身份绑定,允许绑定现有账号和创建新账号 |\n| 1642 | 登录信息补全 |\n| 1643 | 用户自主解锁 |\n| 1699 | 提前终止认证后流程,返回登录界面 |\n| 1700 | 未上传人脸识别的照片 |\n| 1701 | 人脸对比时,未上传需要对比的图片 |\n| 1702 | 人脸校验错误 |\n| 1703 | 未绑定邮箱或手机号,无法绑定人脸 |\n| 1704 | 绑定人脸时,手机验证失败 |\n| 1705 | 绑定人脸时,邮箱验证失败 |\n| 1706 | 人脸已被绑定 |\n| 1707 | 绑定人脸失败 |\n| 2004 | 用户未找到 |\n| 2005 | 用户已锁定 |\n| 2006 | 密码错误 |\n| 2011 | 应用不存在 |\n| 2020 | 尚未登录,无权限访问此请求 |\n| 2031 | 应用已禁止注册用户 |\n| 2039 | 应用域名已被占用 |\n| 2040 | 用户池域名已被占用 |\n| 2058 | 强制重置密码(需要验证旧密码) |\n| 2224 | 用户池不存在 |\n| 2333 | 用户名或密码错误 |\n| 4021 | 计量计费错误 |\n| 6001 | Totp 码错误 |\n| 6002 | Totp 恢复码错误 |\n| 6003 | 未输入 Totp 安全码 |\n| 6004 | 未输入 Totp 恢复码 |\n| 2120008 | 用户已停用或不是此租户成员 |\n| 2130010 | 用户无权限登录此租户 |\n| 2820002 | 无效的 LDAP 链接 |\n\n## 响应数据示例\n\n一个成功的请求响应数据示例如下:\n\n```json\n{\n // 此响应表示请求成功,所以不会返回 apiCode\n \"statusCode\": 200,\n \"message\": \"\",\n \"data\": {\n // ... 省略具体数据\n }\n}\n```\n\n一个失败的请求响应数据示例如下:\n\n```json\n{\n // 此类型错误不具备具体的业务含义,所以不会返回 apiCode\n \"statusCode\": 429,\n \"message\": \"您的请求已超过最大数量限制,请稍后重试\"\n}\n```\n\n以及:\n\n```json\n{\n // 账号不存在或密码错误具备业务含义,所以返回了对应的 apiCode: 2333\n \"statusCode\": 403,\n \"apiCode\": 2333,\n \"message\": \"Account not exists or password is incorrect.\"\n}\n```\n\n## 我该如何处理 statusCode 和 apiCode\n\n在大多数情况下,除非你需要对某些特定的异常做出响应,否则你只需要关注 `statusCode`,不需要关注 `apiCode`。\n比如登录接口,如果你只需要在用户登录失败的时候给出错误提示,可以不用关心 `apiCode`;但是如果你需要对某一种\n特定的业务错误进行额外处理,就需要根据 `apiCode` 进行判断。\n","x-displayName":"错误处理"},{"name":"开发准备/使用管理 API","description":"此部分为 Authing 用户认证 API(V3),所有的 API 均为以终端用户视角发起。如果你需要进行用户管理、组织机构管理、应用管理等管理操作,[点此查看 Authing 管理 API](https://api.authing.cn/openapi/v3/management)。\n","x-displayName":"使用管理 API"},{"name":"登录/概述","description":"# Authing 支持的登录方式\n\n此部分会介绍 Authing 支持的所有登录方式、你该如何选择使用哪种登录方式,以及每种登录方式对应的 API。\n\nAuthing 提供以下四种形式的登录方式,你可以根据自己的具体情况进行选择。\n\n## 使用托管登录页登录\n\n终端用户会跳转到你在 Authing 托管的在线登录页进行认证,认证完成之后回调到你的应用系统。**此端点支持 Authing 现在所有的认证能力,包含密码认证、社会化登录认证、扫码登录等,这也是我们推荐的认证方式**。我们也提供了嵌入式的登录组件 —— Guard,包含[Web 端](https://docs.authing.cn/v2/reference/guard/v2/)、[iOS](https://docs.authing.cn/v2/reference/sdk-for-ios/)、[Android](https://docs.authing.cn/v2/reference/sdk-for-android/)。\n\n<details>\n<summary>点击展开演示示例</summary>\n\n[Authing Browser SDK](https://docs.authing.cn/v3/reference/sdk/web/) 为开发者封装了两种形式:\n\n- `Redirect` 模式:当用户在你的业务系统时,点击登录,浏览器通过 `302` 跳转,替换当前浏览器页面地址,当用户在 Authing 认证完成之后再跳转回来,并携带临时 `code` 用户换取用户凭证。\n\n<iframe width=\"560\" height=\"315\" src=\"https://files.authing.co/api-explorer/authing-ext-idp-conn-web-redirect-with-redirect.mp4\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>\n\n- `Popup` 模式:当用户在你的业务系统时,点击登录,通过弹出浏览器 `Popup` 窗口,不需要替换浏览器当前地址,当用户在 Authing 完成认证之后,通过浏览器的 **Post Message** 和父窗口通信,并返回用户的凭证。\n\n<iframe width=\"560\" height=\"315\" src=\"https://files.authing.co/api-explorer/authing-ext-idp-conn-web-redirect-with-popup.mp4\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>\n\n你还可以指定对应的外部身份源连接,这样将不会展示 Authing 的登录框,而是直接跳转到外部身份源的认证地址:\n\n<iframe width=\"560\" height=\"315\" src=\"https://files.authing.co/api-explorer/authing-ext-idp-conn-web-redirect-with-popup.mp4\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>\n\n</details>\n\n## 外部身份源(社会化)登录\n\n如使用微信扫码登录、GitHub 社会化登录、LDAP 用户目录登录等。\n\n<!-- <details>\n<summary>TODO: 点击展开演示示例</summary>\nTODO\n</details> -->\n\n## 使用用户凭证登录\n\n如账号密码登录、手机号验证码登录、AD 身份源登录等,适合用于希望完全自建登录页面的场景。\n\n<!-- <details>\n<summary>TODO: 点击展开演示示例</summary>\nTODO\n</details> -->\n\n## 移动端社会化登录\n\n如微信移动端社会化登录、支付宝社会化登录等,适合用于移动端。\n\n<!-- <details>\n<summary>TODO: 点击展开演示示例</summary>\nTODO\n</details> -->\n\n## 扫码登录\n\n分为生成二维码、查询二维码状态、使用 ticket 换取 id_token 和 access_token 三个步骤。Authing 目前共支持三种类型的扫码登录:\n[微信公众号扫码登录](https://docs.authing.cn/v2/guides/connections/social/wechatmp-qrcode/)、[Authing 自创的小程序扫码登录](https://authing.co/verify)、[自建 APP 扫码登录](https://docs.authing.cn/v2/guides/authentication/qrcode/use-self-build-app/)。\n如果你感兴趣,也可以了解[扫码登录的原理](https://docs.authing.cn/v2/concepts/how-qrcode-works.html)。\n\n<!-- <details>\n<summary>TODO: 点击展开演示示例</summary>\nTODO\n</details> -->\n\n## 推送登录\n\n如在托管页发起推送登录后,且用户在移动端 APP 上已经登录,此时手机将会收到推送登录的请求,授权登录或取消登录。\n\n<!-- <details>\n<summary>TODO: 点击展开演示示例</summary>\nTODO\n</details> -->\n\n## WebAuthn 无密码认证\n\n如用户在移动端 APP 绑定人脸、指纹之后,就可以在当前设备上使用人脸或指纹进行无密码登录。\n\n<!-- <details>\n<summary>TODO: 点击展开演示示例</summary>\nTODO\n</details> -->\n\n<br>\n\n你可以基于自己的实际情况选择适合自己的登录方式。用户认证完成之后,你可以获取到用户的 `id_token` 和 `access_token`(具体获取方式请分别阅读对应的 API 文档)。\n\n# 我应该选择哪种登录方式\n\n1. 如果你开发的是 Web 应用,我们优先推荐[基于 OIDC 标准协议的认证端点](#tag/登录/API%20列表/operation/OidcV2SignOnController_frontChannelAuth)。Authing 托管的在线登录页完全由 Authing 托管,你不需要部署单独服务器。当有新功能发布时,Authing 托管登录页可以得到实时体现,不需要开发者人工介入。\n2. 如果你开发的是 Web 应用,需要将 Authing 托管的在线登录页以组件形式嵌入到你的业务系统,我们提供了[可嵌入的登录组件 Guard](https://docs.authing.cn/v2/reference/guard/v2/)。\n3. 如果你开发的是 Web 应用,并希望**自建登录页面**,我们提供了以下原子化 API 供你选择:\n\n- [使用用户凭证登录接口](#tag/登录/概述/使用用户凭证登录):基于用户凭证的认证方式(用户名 + 密码,邮箱 + 密码,手机号 + 密码,账号(用户名、邮箱、手机号三合一) + 密码)、基于一次性临时验证码(手机号 + 验证码,邮箱 + 验证码)、基于 LDAP 用户目录、基于 AD 用户目录。\n- [外部身份源登录](#tag/登录/概述/外部身份源(社会化)登录):跳转到第三方外部身份源(比如社会化登录)进行认证。\n- [扫码登录](#tag/登录/概述/扫码登录): 包含生成二维码、查询二维码状态、使用 ticket 换取 id_token 和 access_token 三个接口。\n\n4. 如果你开发的是移动端应用,我们优先推荐使用 [iOS](https://docs.authing.cn/v2/reference/sdk-for-ios/)/[Android](https://docs.authing.cn/v2/reference/sdk-for-android/) 版本的 Guard 组件。如果你希望完全自定义 UI 样式,和 Web 端类似,我们也提供了[使用用户凭证登录接口](#tag/登录/概述/使用用户凭证登录)、[移动端社会化登录](#tag/登录/概述/移动端社会化登录)的原子化 API。\n\n# 实现单点登录\n\n在了解如何实现单点登录之前,先得明确一下单点登录(也就是我们经常说的 `SSO`)的定义:简单来说,单点登录指的是在多个应用系统中,用户只需登录一次即可访问所有相互信任的应用系统。这里面有几种重要的点:\n\n- **多个应用新系统**: 如果你只有一个应用,理论上就不存在单点登录的问题了。\n- **登录一次**:认证操作应该是在一个**中心的认证系统**中完成(我们一般把他叫做**认证中心**或者**用户中心**)由**认证中心**去同一维护用户的登录态;各个业务子系统需要接入**认证中心**的认证体系,必要的话需要进行一定程度的改造,将**认证中心**的用户登录态作为 **Source Of Truth**。\n- **访问**所有相互信任的应用系统:用户在**认证中心**认证完成后,会携带**用户凭证**跳转到**业务子系统**,业务子系统拿到**用户凭证**之后,后续请求自身系统的 API 时,应该带上此凭证,并且前往**认证中心**校验此凭证的合法性(很多情况下出于性能和实时性的平衡,我们也会在子业务系统处添加缓存,以减少中心服务器的压力)。\n- **互相信任**的应用系统:子业务系统如果要接入**认证中心**,是需要先在**认证中心**进行注册的,一般可以通过**配置回调地址**来防止恶意的第三方获取到**用户凭证**。\n\n如何你要用 Authing 来实现单点登录,Authing 在其中扮演的角色就是**认证中心**了,Authing 会为你维护用户的登录态。\n\n搞清了什么是单点登录之后,我们再来看一下单点登录的几种经典实现方式,以及 Authing 中单点登录的实现方式。\n\n## 基于认证中心的 Cookie/Session\n\n这种方式的核心思路在于:用户在认证中心完成认证之后,认证中心在自己的域名下会写入一个 Cookie,各个子业务系统去请求认证中心的“检查用户是否登录”的接口时,浏览器会携带上此 Cookie,从而获取到用户的登录态。但是考虑到浏览器厂商对于跨域 Cookie 的安全性限制:从 13.1 版本开始,Safari 默认会阻止第三方 Cookie;从 Chrome 83 版本开始,隐身模式下默认禁用第三方 Cookie。其他浏览器也在慢慢进行此类更新以保护用户隐私,很多浏览器将禁用第三方 Cookie 作为了一个安全配置功能。所以依赖于中心认证服务 Cookie 的方式已经变得不太可行。\n\n在 Authing 中,虽然这种方式也可以通过[配置自定义域名](https://docs.authing.cn/v2/guides/deployment/custom-domain.html)来解决,但是我们还是不推荐使用这种方式。\n\n## 基于使用标准协议签发的 Token/Ticket\n\n常用于单点登录的标准协议有 `OIDC`、`CAS` 等:在 `OIDC` 协议中,将认证中心签发的 `id_token` 和 `access_token` 作为用户的登录凭证和身份凭证;而在 `CAS` 中,则是 `Service Ticket` 的形式。以一个具体的场景为例:\n\n当用户希望访问业务系统 A 时,假设此时还未登录:\n\n1. 业务系统 A 检测到当前用户还未登录;\n2. 业务系统 A 发起一个 OIDC 认证请求,浏览器跳转到认证中心;\n3. 认证中心负责使用一切它支持的手段验证用户的身份,如果认证成功,会在认证中心建立一个 SSO Session;\n4. 认证中心携带 `id_token` 和 `access_token`(取决于你选用的授权模式,也可能是用于换取 `id_token` 和 `access_token` 的 `code`) 通过浏览器重定向传递给业务系统 A;\n5. 业务系统 A 将用户的 `id_token` 和 `access_token` 在本地存储起来以便后续使用。\n\n当用户访问业务系统 B 时:\n\n- 业务系统 B 发现本地也还没有用户的会话信息;\n- 业务系统 B 发起一个 OIDC 认证请求,浏览器跳转到认证中心;\n- 由于此时用户在认证中心已经登录过了,所以会直接携带用户的凭证回到业务系统 B;\n- 业务系统 B 将用户的 `id_token` 和 `access_token` 在本地存储起来以便后续使用。\n\n这样就实现了用户只需要登录一次,就可以访问不同的业务系统。\n\n## 在 Authing 中如何实现单点登录\n\n在 Authing 中,我们同时支持 `OIDC` 和 `CAS` 协议,优先还是推荐使用 `OIDC` 来实现,所以 Authing 中的单点登录实现流程和**基于使用标准协议签发的 Token/Ticket** 描述的流程一致,将上述流程中的**认证中心**替换成 Authing 即可。\n\n同时,你还需要将为你在 Authing 中创建的应用[开启 SSO](https://docs.authing.cn/v2/guides/app/sso.html)。\n\n你也可能会疑虑过多的浏览器跳转是否会对用户体验造成影响,对此我们也提供了相应的解决方案:当业务系统需要获取当前用户的登录态时,可以通过隐藏的 **Iframe** 来实现,这样对于用户而言是无感的。具体实现如下:\n\n当用户访问业务系统时,业务系统打开一个隐藏的 **Iframe**,地址为 `OIDC` 的认证端点,如下所示:\n\n```\nhttps://<YOUR_DOMAIN>.authing.cn/oidc/auth?redirect_uri=https://example.com/callback&response_mode=web_message&response_type=code&client_id=<YOUR_APP_ID>&prompt=none&scope=openid profile\n```\n\n> 在上述地址中,我们指定了 `response_mode` 为 `web_message`。\n\n当 **Iframe** 访问 `/oidc/auth` 接口时,如果此用户在 Authing 已经有登录态了,Authing 会直接通过 Window 的 **Post Message**方式,将用户的 `id_token` 和 `access_token` 给到业务系统。\n\n针对上述流程,我们已经封装好了相应的 SDK:[单点登录(SSO)](https://docs.authing.cn/v2/reference/sdk-for-sso-spa.html)。\n\n# 对登录流程进行扩展\n\n借助于 [Authing Pipeline](https://docs.authing.cn/v2/guides/pipeline/) ,我们可以在用户认证前和认证后插入自定义代码,轻松实现「终端用户 License 到期之后禁止登录」、「用户登录之后发送飞书通知」等自定义逻辑。\n\n![](https://cdn.authing.cn/blog/authing-pipeline.png)\n\n以 「用户登录之后发送飞书通知」为例,你可以在**认证后**的 Pipeline 流程中添加一段自定义代码:\n\n```javascript\nasync function pipe(user, context, callback) {\n const webhook = env.LARK_WEBHOOK;\n await axios.post(webhook, {\n title: 'Authing 新用户注册 ~',\n text: `用户信息:\nID: ${user.id}\n昵称:${user.username}\n注册方式:${user.registerSource}\n邮箱:${user.email}\n手机号:${user.phone}\nUA: ${user.device}\n`,\n });\n return callback(null, user, context);\n}\n```\n\n# 使用托管登录页登录\n\n使用这种方式,终端用户会通过浏览器 `302` 重定向跳转到你在 Authing 托管的在线登录页进行认证,认证完成之后回调到你的应用系统。**此端点支持 Authing 现在所有的认证能力,包含密码认证、社会化登录认证、扫码登录等,这也是我们推荐的认证方式**。\n\n在开始之前,你需要为你的应用[选择合适的 OIDC 授权模式](https://docs.authing.cn/v2/concepts/oidc/choose-flow.html)。\n\n用户认证完成之后,会通过 OIDC 标准协议跳转到你配置的回调地址,你可以在此获取用户的 [id_token](https://docs.authing.cn/v2/concepts/id-token.html) 和\n[access_token](https://docs.authing.cn/v2/concepts/access-token.html)。 `id_token` 是用户的身份凭证, `access_token` 是用户访问后端资源的凭证,请求后端服务器的时候,你应该在 `authorization` 请求头中携带 `access_token`。\n\n### 了解更多\n\n1. 了解如何为你的应用添加社会化登录方式: [https://docs.authing.cn/v2/guides/connections/social.html](https://docs.authing.cn/v2/guides/connections/social.html)\n2. 了解如何配置应用登录方式:[https://docs.authing.cn/v2/guides/app/config-login-methods.html](https://docs.authing.cn/v2/guides/app/config-login-methods.html)\n3. 了解如何自定义登录页面样式:[https://docs.authing.cn/v2/guides/app/custom-styles.html](https://docs.authing.cn/v2/guides/app/custom-styles.html)\n4. 了解如何给你的应用开启 MFA 多因素认证:[https://docs.authing.cn/v2/guides/app/mfa.html](https://docs.authing.cn/v2/guides/app/mfa.html)\n5. 了解如何为你的应用开启自定义域名:[https://docs.authing.cn/v2/guides/deployment/custom-domain.html](https://docs.authing.cn/v2/guides/deployment/custom-domain.html)\n6. 默认情况下,`id_token` 只会返回 Authing 内置的字段,你也可以[为 `id_token` 添加任意自定义数据](https://docs.authing.cn/v2/guides/authentication/extensibility/customize-id-token.html)。\n7. 你还可以在认证前后插入一些自定义代码逻辑,实现如「终端用户 License 到期之后禁止登录」、「用户登录之后发送飞书通知」等自定义逻辑,详情请了解[配置自定义认证流程(Pipeline)](https://docs.authing.cn/v2/guides/pipeline/)。\n\n# 外部身份源(社会化)登录\n\n由于绝大多数的外部身份源登录不允许在第三方系统直接输入账号密码进行登录,所以外部身份源的绑定总是需要先跳转到对方的登录页面进行认证。\n\n# 使用用户凭证登录\n\nAuthing 目前支持以下几种基于用户凭证的认证方式:\n\n- 基于 Authing 认证服务器的密码(`PASSWORD`):用户名 + 密码,邮箱 + 密码,手机号 + 密码,账号(用户名、邮箱、手机号三合一) + 密码。\n- 基于一次性临时验证码(`PASSCODE`):手机号 + 验证码,邮箱 + 验证码。你需要先调用**发送短信**或者**发送邮件**接口获取验证码。\n- 基于 LDAP 用户目录(`LDAP`):使用外部的 LDAP 用户目录进行认证。你需要先[配置 LDAP 身份源](https://docs.authing.cn/v2/guides/connections/enterprise/ldap/)。\n- 基于 AD 用户目录(`AD`):使用外部的 Windows AD 用户目录进行认证。你需要先[配置 Windows AD 身份源](https://docs.authing.cn/v2/guides/connections/enterprise/windows-ad/)。\n\n用户认证完成之后,此接口会返回用户的 id_token 和 access_token。 id_token 是用户的身份凭证, access_token 是用户访问 后端资源的凭证,请求后端服务器的时候,你应该在 authorization 请求头中携带 access_token。\n\n### 了解更多\n\n1. 默认情况下,Authing 会为你安全地存储用户数据,你也可以[配置外部数据库连接](https://docs.authing.cn/v2/guides/database-connection/overview.html),使用自己的数据库存储用户数据。API 调用形式不受影响。\n2. 如果你有历史用户的密码需要迁移,可以[配置自定义密码函数](https://docs.authing.cn/v2/guides/migrations/custom-password-script/)。\n3. 默认情况下,`id_token` 只会返回 Authing 内置的字段,你也可以[为 `id_token` 添加任意自定义数据](https://docs.authing.cn/v2/guides/authentication/extensibility/customize-id-token.html)。\n4. 你还可以在认证前后插入一些自定义代码逻辑,实现如「终端用户 License 到期之后禁止登录」、「用户登录之后发送飞书通知」等自定义逻辑,详情请了解[配置自定义认证流程(Pipeline)](https://docs.authing.cn/v2/guides/pipeline/)。\n\n# 移动端社会化登录\n\n[点此](https://docs.authing.cn/v2/guides/connections/social.html)查看 Authing 目前支持的所有移动端社会化登录方式,如果你还没有配置对应的社会化登录,请先在 Authing 控制台进行配置。\n\n# 扫码登录\n\n一个扫码登录流程分为生成二维码、查询二维码状态、使用 ticket 换取 id_token 和 access_token 三个步骤。Authing 目前共支持三种类型的扫码登录:\n[微信公众号扫码登录](https://docs.authing.cn/v2/guides/connections/social/wechatmp-qrcode/)、[Authing 自创的小程序扫码登录](https://authing.co/verify)、[自建 APP 扫码登录](https://docs.authing.cn/v2/guides/authentication/qrcode/use-self-build-app/)。\n如果你感兴趣,也可以了解[扫码登录的原理](https://docs.authing.cn/v2/concepts/how-qrcode-works.html)。\n\n如果是**微信公众号扫码登录**和**Authing 自创的小程序扫码登录**,开发者不需要进行额外的工作去驱动二维码的状态,因为扫码的载体是微信 APP 和 Authing 的小程序。如果是自建 APP 扫码登录,就需要开发者在移动端接入,[使用 Authing 终端用户的身份进行扫码、确认授权、取消授权等操作](#tag/登录/API%20列表/operation/SignInV3Controller_changeQRCodeStatus)。\n\n# 推送登录\n\n仅 「标准 Web 应用」和「单页 Web 应用」支持**推送登录**。\n\n# WebAuthn 无密码认证","x-displayName":"概述"},{"name":"登录/API 列表","description":"","x-displayName":"API 列表"},{"name":"登录/事件","description":"用户登录之后,你可以获得对应的 Webhook 事件通知,详情请见[使用 Webhook 监听事件](https://docs.authing.cn/v2/guides/webhook/)。\n","x-displayName":"事件"},{"name":"管理 Token/概述","description":"# 基本概念\n\n当你的终端用户在登录之后,取决你使用的登录端点以及选择的 OIDC 授权模式,你可能需要使用获取用户的 `id_token`, `access_token` 和 `refresh_token`。\n\n在开始获取 `id_token`, `access_token` 和 `refresh_token` 之前,你需要先了解一下这三个 Token 的基本概念。\n\n## 什么是 Id Token\n\n[OIDC (OpenID Connect) 协议](https://openid.net/specs/openid-connect-core-1_0.html)对 [OAuth 2.0 协议](https://www.rfc-editor.org/rfc/rfc6749)最主要的一个扩展就是 **ID Token** 数据结构。当一个用户经过 OIDC 认证之后,可以获取到他的 **ID Token**,**ID Token** 相当于该用户的身份凭证,你可以理解为他的**身份证**。\n\nID Token 本质上是一个 **JSON Web Token**(JWT), 所以你可以很轻松获取到该用户的用户资料,同时 JWT 的机制也确保了 ID Token 的内容不会\n被其他人恶意伪造和篡改。如果你想了解更多 JWT 相关的内容,可以阅读[什么是 JWT Token](https://docs.pre.authing.cn/v2/concepts/jwt-token.html)。\n\n一个示例的 ID Token 如下所示:\n\n```\neyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI2MmVhYTk1ZmNhMWM1OTZjNTk5YjY3OWYiLCJhdWQiOiI2MmY3MzNhNzE0OGJmOTU4YWYxZTU0MTAiLCJpYXQiOjE2NjA4MDE1MjEsImV4cCI6MTY2MjAxMTEyMSwiaXNzIjoiaHR0cHM6Ly9zYWRkZGYuY2oubWVyZWl0aC5jb20vb2lkYyIsIm5vbmNlIjoiVGpESkRUaFcwaCIsIm5hbWUiOm51bGwsImdpdmVuX25hbWUiOm51bGwsIm1pZGRsZV9uYW1lIjpudWxsLCJmYW1pbHlfbmFtZSI6bnVsbCwibmlja25hbWUiOm51bGwsInByZWZlcnJlZF91c2VybmFtZSI6bnVsbCwicHJvZmlsZSI6bnVsbCwicGljdHVyZSI6Imh0dHBzOi8vZmlsZXMuYXV0aGluZy5jby9hdXRoaW5nLWNvbnNvbGUvZGVmYXVsdC11c2VyLWF2YXRhci5wbmciLCJ3ZWJzaXRlIjpudWxsLCJiaXJ0aGRhdGUiOm51bGwsImdlbmRlciI6IlUiLCJ6b25laW5mbyI6bnVsbCwibG9jYWxlIjpudWxsLCJ1cGRhdGVkX2F0IjoiMjAyMi0wOC0xN1QwNjozNToyOC4zNzZaIiwiZW1haWwiOm51bGwsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwicGhvbmVfbnVtYmVyIjpudWxsLCJwaG9uZV9udW1iZXJfdmVyaWZpZWQiOmZhbHNlfQ.KDCWkSCxek_-fuRzH7kq8lU_NYMYZKns4gquUoyosi0\n```\n\n这是一个通过 `Base64` 编码(非加密)的字符串,你可以非常简单得通过[各种语言客户端](https://jwt.io/)解码以及验证它的内容:\n\n```json\n{\n \"sub\": \"user_id\",\n \"aud\": \"app_id\",\n \"iat\": 1660211717,\n \"exp\": 1661421317,\n \"iss\": \"https://your_domain.authing.cn/oidc\",\n \"nonce\": \"r7HSS7s_HW\",\n \"name\": null,\n \"given_name\": null,\n \"middle_name\": null,\n \"family_name\": null,\n \"nickname\": null,\n \"preferred_username\": null,\n \"profile\": null,\n \"picture\": \"https://files.authing.co/authing-console/default-user-avatar.png\",\n \"website\": null,\n \"birthdate\": null,\n \"gender\": \"U\",\n \"zoneinfo\": null,\n \"locale\": null,\n \"updated_at\": \"2022-08-11T09:55:15.267Z\",\n \"email\": \"test@example.com\",\n \"email_verified\": false,\n \"phone_number\": null,\n \"phone_number_verified\": false\n}\n```\n\n其中有几个重要的字段:\n\n- `sub`: 用户 ID;\n- `aud`: Authing 应用 ID;\n- `iss`: 签发此 Token 的 OIDC Issuer\n\n其他的则是用户的一些其他用户信息。\n\n**有个 `id_token` 之后,你可以知道用户的身份(`sub`),从而和你业务系统中的业务数据关联起来;你还可以基于用户的个人资料进行展示。**\n\n## 什么是 Access Token\n\n`access_token` 是用户访问后端资源的凭证,请求后端服务器的时候,**你应该在 authorization 请求头中携带 access_token(而非 id_token)**。以 `CURL` 为例:\n\n```bash\n$ curl -i --request GET \\\\\n--url http://localhost:5000/api/protected \\\\\n--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IlRmTE90M0xibjhfYThwUk11ZXNzYW1xai1vM0RCQ3MxLW93SExRLVZNcVEifQ.eyJqdGkiOiJTUWxFSGRzTk54MDc4TThwT1R6djMiLCJpYXQiOjE2MTk1MzA4MzQsImV4cCI6MTYxOTUzNDQzNCwic2NvcGUiOiJvcGVuaWQiLCJpc3MiOiJodHRwczovL29pZGMxLmF1dGhpbmcuY24vb2lkYyIsImF1ZCI6IjYwNTA3NTFhZWQwZjI5YmY3NzIzYzdhOCIsImF6cCI6IjVmMTdhNTI5ZjY0ZmIwMDliNzk0YTJmZiJ9.QsthJdDM5TNtfQOAzy6EwuedK9r03SzkgE2GQkQCLv8SZJhg-tOIKzHqjDDUmRTkJPLl3HHQTUAzfS3UUYwOiah3smiYF7ynx6jukaoGyHTIgXXwavUVmD5j-mnD3kZrLAo-dh5BLBQfLiiE_WlOkQvnKC160K9ETuwQlhx1TGJts0-sMsjsiRx28EJvdrdWw8CVHGiQVzvCE6kHkYmkO6VTkgEnHNqpRpdB0IysIeKUOWezgGZE-Dmtyam6c8nXW_lr798B194zVyjSOuwGt1tqEfRpBDYiD_ER29aWjH2UbI0pjko_15Ldqno9RgehTJXv5suQ6zdfrER-6b5Bmg'\n```\n\n`access_token` 是有一定实效期限的,当 `access_token` 过期时,你就需要使用 `refresh_token` 换取新的 `access_token` 。\n\n## 什么是 Refresh Token\n\n一个 `refresh_token` 就是一个用于获取新的 `access_token` 的特殊 Token,每次换取新的 `access_token` 时,你会再次得到一个新的 `refresh_token`。你的系统应该安全得存储 `refresh_token`,因为 `refresh_token` 可以让用户在一个相对长时间的期限内维持登录态。\n\n如果你想获取 `refresh_token`,当你在[发起 OIDC 登录](#tag/登录/API%20列表/operation/OidcV2SignOnController_frontChannelAuth)的时候,需要在 `scope` 中添加 `offline_access`。\n\n# 选择合适的授权模式\n\nOIDC 全称 OpenID Connect,有以下几种授权模式,分别是:\n\n- 授权码模式\n- 隐式模式\n- 混合模式\n- Client Credentials 模式\n- 密码模式\n- 授权码 + PKCE 模式\n\n## 授权码模式\n\n如果在你的应用中,**认证流程需要后端服务参与**,建议使用授权码模式。\n\n整体流程如下:\n\n1. 在你的应用中,让用户访问登录链接,浏览器跳转到 Authing,用户在 Authing 完成**认证**。\n2. Authing 服务器会签发一个临时的**授权码**,并通过浏览器重定向将授权码发送到你的应用后端。\n3. 你的应用服务后端将获取到的授权码发送到 Authing 服务器,获取 AccessToken 和 IdToken,如果需要,还会返回 Refresh Token。\n4. 你的应用后端现在可以通过 IdToken 知道用户的身份,后续可以保存用户会话信息。并可以重定向到前端其他页面,使用 AccessToken 调用你的后端 API 等等。\n\n<img src=\"https://cdn.authing.co/authing-docs-v2/1.3.96/assets/img/1-3.f80500ca.png\" alt=\"drawing\" />\n\n## 授权码 + PKCE 模式\n\n如果你的应用是一个 **SPA 前端应用或移动端 App**,建议使用**授权码 + PKCE 模式**。授权码 + PKCE 模式**适合不能安全存储密钥的场景**(例如前端浏览器)。\n\n整体流程如下:\n\n1. 在你的应用中,让用户访问登录链接,浏览器跳转到 Authing,用户在 Authing 完成**认证**。\n2. Authing 服务器会签发一个临时的**授权码**,并通过浏览器重定向将授权码发送到你的应用前端。\n3. 你的应用将**授权码**和**校验码**发送到 Authing 获取 **AccessToken** 和 **IdToken**,如果需要,还会返回 Refresh token。\n4. 你的应用前端现在通过 IdToken 知道了用户的身份,后续使用 Access token 换取用户信息,重定向到前端其他页面,使用 AccessToken 调用你的后端 API 等等。\n\n<img src=\"https://cdn.authing.co/authing-docs-v2/1.3.96/assets/img/pkce-2.7ef745c5.png\" alt=\"drawing\" />\n\n## 隐式模式\n\n如果你的应用是一个 **SPA 前端应用**,也可以使用**隐式模式**来完成用户的认证和授权。隐式模式**适合不能安全存储密钥的场景**(例如前端浏览器)。在**隐式模式**中,应用不需要使用 code 换 token,无需请求 `/oidc/token` 端点,AccessToken 和 IdToken 会直接从**认证端点**返回。\n\n整体流程如下:\n\n1. 在你的应用中,让用户访问登录链接,浏览器跳转到 Authing,用户在 Authing 完成**认证**。\n2. Authing 服务器会直接签发用户的 AccessToken 和 IdToken,并通过浏览器重定向在 **URL hash** 中将发送到你的应用前端。\n3. 你的应用从 URL 中取出 AccessToken 和 IdToken。\n4. 你的应用可以将 AccessToken 与 IdToken 保存,以便后续使用,例如携带 AccessToken 访问资源服务器,携带 IdToken 请求服务端从而服务端能够辨别用户身份。\n\n<img src=\"https://cdn.authing.co/authing-docs-v2/1.3.96/assets/img/implicit-flow.fdb49293.png\" alt=\"drawing\" />\n\n## 混合模式\n\n在某些场景你可能既希望直接从认证端点获取 AccessToken 和 IdToken,又能获取授权码 code 用于后续获取 Refresh token,建议使用**混合模式**。\n在**混合模式**中,应用会收到 AccessToken 和 IdToken 与 code。应用可以选择将 code 发送给后端服务,用于从 `/oidc/token` 端点获取用户的 AccessToken、IdToken、Refresh token。\n\n整体流程如下:\n\n1. 在你的应用中,让用户访问登录链接,浏览器跳转到 Authing,用户在 Authing 完成**认证**。\n2. Authing 服务器会直接签发一个临时的授权码 code,以及用户的 AccessToken 和 IdToken,并通过浏览器重定向在 **URL hash** 中将发送到你的应用前端。\n3. 你的应用从 URL 中取出 code 和 AccessToken、IdToken。\n4. 你的应用可以将 AccessToken 与 IdToken 保存,以便后续使用,例如携带 AccessToken 访问资源服务器,携带 IdToken 请求服务端从而服务端能够辨别用户身份。\n5. 你的应用可以将 code 发送给后端。\n6. 应用后端可以利用 code 获取用户的 AccessToken、IdToken 以及 refresh token。之后可以保存用户信息,使用 AccessToken 调用资源方的其他 API 等等。\n\n<img src=\"https://cdn.authing.co/authing-docs-v2/1.3.96/assets/img/hybrid-flow.53529f18.png\" alt=\"drawing\" />\n\n## Client Credentials 模式\n\nClient Credentials 模式用于进行服务器对服务器间的授权(M2M 授权),期间没有用户的参与。你需要创建编程访问账号,并将 AK、SK 密钥对交给你的资源调用方。\n\n整体流程如下:\n\n1. 资源调用方将他的凭证 AK、SK 以及需要请求的权限 scope 发送到 Authing 授权端点。\n2. 如果凭证正确,并且调用方具备资源权限,Authing 为其颁发 AccessToken。\n\n<img src=\"https://cdn.authing.co/authing-docs-v2/1.3.96/assets/img/client-credentials-flow.1434552a.png\" alt=\"drawing\" />\n\n## 密码模式\n\n不推荐使用此模式,尽量使用其他模式。只有其他模式都无法解决问题时才会考虑使用**密码模式**。如果使用密码模式,请确保你的应用代码逻辑非常安全,不会被黑客攻击,否则将会**直接泄露用户的账密**。一般用于改造集成非常古老的应用,否则**绝对不要**把它作为你的第一选择。\n\n整体流程如下:\n\n1. 你的应用让用户输入账密信息。\n2. 你的应用将用户账密发送到 Authing。\n3. 如果账密正确,Authing 返回 token。\n\n<img src=\"https://cdn.authing.co/authing-docs-v2/1.3.96/assets/img/password-flow.99e74271.png\" alt=\"drawing\" />\n\n# 对签发 Token 流程进行扩展\n\n借助于 [Authing Pipeline](https://docs.authing.cn/v2/guides/pipeline/) ,我们可以在**签发 ID Token 前后**插入自定义代码,轻松实现「给 ID Token 添加自定义字段」、「给 Access Token 添加自定义字段」等自定义逻辑。\n\n![](https://cdn.authing.cn/blog/authing-pipeline.png)\n\n以 「给 ID Token 添加自定义字段」为例,你可以在**签发 Id Token 前**的 Pipeline 流程中添加一段自定义代码:\n\n```javascript\nasync function pipe(user, context, callback) {\n user.addIdToken('KEY', 'VALUE');\n callback(null, user, context);\n}\n```\n\n# 后端服务如何为接口添加鉴权\n\n为了保护业务应用的接口,必须在业务应用里面添加代码。我们基于这样的思路保护 API 接口:终端用户调用 Authing 的认证接口,\n认证通过之后 Authing 签发 access,然后调用者携带 access_token 访问业务系统接口,业务系统接口检验 access_token 合法性,\n并验证其中的权限项目,通过后再返回数据。\n\n完整的序列图如下:\n\n<img src=\"https://cdn.authing.co/authing-docs-v2/1.3.96/assets/img/sequence.97f31b25.png\" alt=\"drawing\" height=\"300\"/>\n\n你可以阅读下面的 Qucik Start,了解如何在常见的 Web 框架中对接口添加权限验证的能力:\n\n- [Node.js Express API Server 快速开始](https://docs.authing.cn/v2/quickstarts/apiServer/nodeJsExpress)\n- [Java Spring Boot 快速开始](https://docs.authing.cn/v2/quickstarts/webApp/javaSpringBoot.html)\n","x-displayName":"概述"},{"name":"管理 Token/API 列表","description":"","x-displayName":"API 列表"},{"name":"管理 Token/常见问题","description":"## 为什么我的 id_token 中没有用户名\n\n发起登录的时候,会访问一个链接,例如 /oidc/auth?,后面的 scope 参数里面需面包含 openid email phone username 才会返回带这些信息的 token\n\n<!-- ## 为什么我的 id_token 中没有我想要的字段 -->\n\n## 为什么 access_token 中没有用户信息\n\nAccess Token 在设计上就没有用户信息,如果你需要一个包含用户信息的 Token 可以使用 ID Token,或者在控制台 Pipeline 里签发 ID Token 场景里面写脚本给 ID Token 加入自定义字段。\n\n## 为什么返回的 TokenSet 中没有 refresh_tokn\n\n发起登录的时候 /oidc/auth? 里面 scope 参数必须包含 offline_access,而且必须有 prompt=consent 这个参数\nAuthing 控制台必须勾选 refresh_token,缺一不可。\n\n## 为什么我获取 Refresh Token,用户会弹出一个确权页面?\n\nOIDC 协议规范要求,获取 refresh_token 必须每次让用户确权。\n\n## 一个应用的 ID Token 和 Access Token 能用其他应用的 ID 和 Secret 来验签吗?\n\n不可以。\n\n## 不用 client_secret 可以拿到 code 吗?\n\n如果使用的授权码模式且 token 端点验证模式选择的是 none,那么不用 client_secret。\n\n如果使用了隐式模式,那么 token 会以 URL hash 的方式直接返回到回调地址,不用 client_secret。\n\n## 换取 Token 接口常见的错误\n\n### {\"error\":\"invalid_grant\",\"error_description\":\"grant request is invalid\"}\n\n可能原因:\n\n- ClientID+ClientSecret 不正确\n- code 过期\n- code 已经被使用过,code 有效期十分钟,且只能用一次\n- redirect_uri 不正确,和发起登录时不一致\n\n### client authentication failed\n\n可能原因:\n\n- ClientID+ClientSecret 不正确\n- 配置的 Token 获取端点的验证方式和实际调用 Token 端点时使用的验证方式不一致\n - 比如配的是 none,却传了 client_id 和 client_secret 到 token 端点,发生不一致\n - 配的是 client_secret_post 却没传 client_secret 参数给 /oidc/token 端点\n","x-displayName":"常见问题"},{"name":"管理 Token/事件","description":"","x-displayName":"事件"},{"name":"登出/概述","description":"# 基本概念\n\n## 前端登出\n\n前端登出指的是用户前端手动参与的登出行为,一般需要借助浏览器的参与,在浏览器直接访问登出端点。且只能登出当前账号。\n\n## 后端登出\n\n后端登出指的是在后端服务通过用户的身份凭证(一般是 `id_token`)调用登出端点,来删除相关用户的会话,从而实现前端登出的效果。\n\n## 强制下线\n\n强制下线指的是管理员直接操作某个账号下线,可以登出任意用户。\n\n## 单点登出\n\n单点登出指的是用户登出一次之后就能**退出他登录的所有系统**,和前面介绍的[单点登录](#tag/登录/概述/实现单点登录)类似,各个业务子系统需要接入**认证中心**的认证体系,必要的话需要进行一定程度的改造,将认证中心的用户登录态作为 **Source Of Truth**。\n\n# 如何实现单点登出\n\n根据不同端和具体使用场景,我们提供了**前端登出**和**后端登出**两种登出方式:\n\n- **前端登出**:前端登出指的是用户在前端访问登出地址,登出之后服务器会清除用户的登录态。这种登出方式一般需要借助浏览器的参与,需要在浏览器环境下使用。Node SDK 提供了生成登出地址的方法,开发者可以引导用户在前端访问此地址。\n- **后端登出**:后端登出指的是在后端服务中调用撤销 `access_token` 的方法,使用户的 `access_token` 失效,实现登出的效果,适合使用 Token 的方式管理登录态的场景。\n\n根据不同端和具体使用场景,我们提供了**前端登出**和**后端登出**两种登出方式:\n\n- **前端登出**:前端登出指的是用户在前端访问登出地址,登出之后服务器会清除用户的登录态。这种登出方式一般需要借助浏览器的参与,需要在浏览器环境下使用。Node SDK 提供了生成登出地址的方法,开发者可以引导用户在前端访问此地址。\n- **后端登出**:后端登出指的是在后端服务中调用撤销 `access_token` 的方法,使用户的 `access_token` 失效,实现登出的效果,适合使用 Token 的方式管理登录态的场景。\n\n在 Authing 系统中,如果一个应用需要实现单点登出效果,必须为此应用[开启 SS0](https://docs.authing.cn/v2/guides/app/sso.html)。开启 SSO 之后,访问此应用的二级域名时,将会直接跳转到用户池单点登录 SSO 的域名,此应用下用户的登录态将会是单点登录 SSO 的登录态。\n\n### 第一步:应用开启 SSO\n\n在 Authing 控制台的**自建应用** - **应用详情** - **访问授权** 配置页面,开启**添加到单点登录**开关:\n\n![](https://files.authing.co/api-explorer/app-enable-sso.jpg)\n\n### 第二步:获取 SSO 应用面板的域名\n\n在 Authing 控制台的**单点登录 SSO** - **配置**页面,可以看到你的**应用面板登录地址**:\n\n![](https://files.authing.co/api-explorer/sso-launchpad-domain.jpg)\n\n### 第三步:访问 SSO 应用面板的登出端点\n\n调用[登出](#tag/登出/API%20列表/operation/OidcV2LogoutController_frontChannelLogout)端点,**注意此时需要访问应用面板的域名,而非此应用的域名!**\n\n当使用 SSO 应用面板的登出端点进行登出操作之后,所有加入了 SSO 应用面板的应用登录态都将会失效。\n\n你可以尝试此[单点登录与单点登出的 Demo](https://github.com/Authing/authing-browser-sdk/blob/master/example/sso/react/README.md)。\n\n# 后端登出\n\n后端登出指的是在后端服务中调用撤销 `access_token` 的方法,使用户的 `access_token` 失效,实现登出的效果,适合使用 Token 的方式管理登录态的场景。详情请见[撤销 Token 接口](#tag/管理%20Token/API%20列表/operation/OidcV2TokenController_revokeToken)\n\n# 强制下线\n\n强制下线属于管理 API 的部分,用于管理员强制下线某个用户,详情请见 Authing 管理 API 的**用户管理模块**的[强制下线用户](#tag/管理用户/API%20列表/operation/UsersManagementController_kickUsers)接口。\n","x-displayName":"概述"},{"name":"登出/API 列表","description":"","x-displayName":"API 列表"},{"name":"登出/事件","description":"用户登出之后,你可以获得对应的 Webhook 事件通知,详情请见[使用 Webhook 监听事件](https://docs.authing.cn/v2/guides/webhook/)。\n","x-displayName":"事件"},{"name":"注册/概述","description":"# 对注册流程进行扩展\n\n此部分介绍用户自主注册账号的流程,如果你有历史用户需要导入,请见管理侧 API 导入用户接口的介绍。\n\n借助于 [Authing Pipeline](https://docs.authing.cn/v2/guides/pipeline/) ,我们可以在用户注册前和注册后插入自定义代码,轻松实现「只允许特定邮箱后缀的用户注册」、「特定时间段禁止注册」等自定义逻辑。\n\n![](https://cdn.authing.cn/blog/authing-pipeline.png)\n\n以 「只允许特定邮箱后缀的用户注册」为例,你可以在**注册前**的 Pipeline 流程中添加一段自定义代码:\n\n```javascript\nasync function pipe(user, context, callback) {\n const { email } = context.request.body;\n // 非邮箱注册方式\n if (!email) {\n return callback(null, user, context);\n }\n if (!email.endsWith('example.com')) {\n return callback(new Error('Access denied.'));\n }\n return callback(null, user, context);\n}\n```\n","x-displayName":"概述"},{"name":"注册/API 列表","description":"","x-displayName":"API 列表"},{"name":"注册/事件","description":"用户注册之后,你可以获得对应的 Webhook 事件通知,详情请见[使用 Webhook 监听事件](https://docs.authing.cn/v2/guides/webhook/)。\n","x-displayName":"事件"},{"name":"用户资料/概述","description":"此部分介绍如何**以终端用户的身份**管理自己的用户资料,如手机号、邮箱、密码、其他个人信息以及扩展字段等。当以终端用户的身份管理自己的资料时,部分接口需要提供相应的验证手段,如修改密码需要验证当前密码。如果你需要基于 Authing 的 API 开发后台的管理页面,你需要使用 Authing 管理 API 的用户管理部分,和此部分的 API 区别点在于,管理 API 是以管理员的身份进行操作,不需要进行额外验证。\n\n\n\n- 终端用户自主修改邮箱,需要提供相应的验证手段,见[先发起修改邮箱的验证请求](#tag/用户资料/API%20列表/operation/ProfileV3Controller_verifyUpdateEmailRequest)。\n\n- 终端用户自主修改手机号,需要提供相应的验证手段,见[先发起修改手机号的验证请求](#tag/用户资料/API%20列表/operation/ProfileV3Controller_verifyUpdatePhoneRequest)。\n","x-displayName":"概述"},{"name":"用户资料/API 列表","description":"","x-displayName":"API 列表"},{"name":"用户资料/事件","description":"用户资料修改发生之后,你可以获得对应的 Webhook 事件通知,详情请见[使用 Webhook 监听事件](https://docs.authing.cn/v2/guides/webhook/)。\n","x-displayName":"事件"},{"name":"用户资料/常见问题","description":"\n","x-displayName":"常见问题"},{"name":"账号绑定/概述","description":"此部分介绍如何管理用户绑定的外部身份源(如绑定的微信、GitHub 社会化登录),包含绑定、解绑外部身份源、获取已绑定身份源等。\n","x-displayName":"概述"},{"name":"账号绑定/API 列表","description":"","x-displayName":"API 列表"},{"name":"账号绑定/事件","description":"用户绑定、解绑身份源之后,你可以获得对应的 Webhook 事件通知,详情请见[使用 Webhook 监听事件](https://docs.authing.cn/v2/guides/webhook/)。\n","x-displayName":"事件"},{"name":"MFA 要素管理/概述","description":"此部分介绍用户如何使用 API 管理自己的 MFA 要素,如绑定 OTP 要素、绑定短信要素、解绑 MFA 要素等。\n","x-displayName":"概述"},{"name":"MFA 要素管理/API 列表","description":"\n","x-displayName":"API 列表"},{"name":"MFA 要素管理/事件","description":"用户绑定、解绑之后,你可以获得对应的 Webhook 事件通知,详情请见[使用 Webhook 监听事件](https://docs.authing.cn/v2/guides/webhook/)。\n","x-displayName":"事件"},{"name":"用户相关资源/概述","description":"此部分介绍用户如何使用 API 获取自己的相关资源,如获取登录日志、获取被授权的角色列表、获取被授权的资源的。\n","x-displayName":"概述"},{"name":"用户相关资源/API 列表","description":"\n","x-displayName":"API 列表"},{"name":"用户相关资源/事件","description":"","x-displayName":"事件"},{"name":"消息服务/概述","description":"此部分介绍如何发送短信和邮件。默认情况下,Authing 会使用内置的短信服务商和邮件服务商发送短信和邮件,同时会使用内置的短信和邮件模版,你也可以阅读[配置邮件服务和模版](https://docs.authing.cn/v2/guides/userpool-config/email/)和[配置短信服务](https://docs.authing.cn/v2/guides/userpool-config/sms/)了解如何配置自定义短信/邮件服务商,以及自定义邮件模版。\n","x-displayName":"概述"},{"name":"消息服务/API 列表","description":"","x-displayName":"API 列表"},{"name":"消息服务/常见问题","description":"## 如何给海外手机号发送短信\n\nAuthing 目前内置的短信服务不支持国际手机号,你需要先[配置海外短信服务商](https://docs.authing.cn/v2/guides/userpool-config/sms/#%E5%9B%BD%E9%99%85%E7%9F%AD%E4%BF%A1%E6%9C%8D%E5%8A%A1)。\n","x-displayName":"常见问题"},{"name":"消息服务/事件","description":"","x-displayName":"事件"},{"name":"鉴权/概述","description":"此部分介绍用户如何使用 API 判断自己对某个资源是否拥有操作权限。\n","x-displayName":"概述"},{"name":"鉴权/API 列表","description":"","x-displayName":"API 列表"},{"name":"鉴权/事件","description":"","x-displayName":"事件"},{"name":"微信相关接口/概述","description":"此部分为 Authing 专门为微信场景提供的 API:\n\n- [解密微信小程序数据](#tag/微信相关接口/API%20列表/operation/WechatAPIV3Controller_decryptWechatMiniProgramData)\n- [获取 Authing 服务器缓存的微信小程序、公众号 Access Token](#tag/微信相关接口/API%20列表/operation/WechatAPIV3Controller_getWechatMpAccessToken)\n\n如果你需要使用微信登录,请见[登录部分的 API](#tag/登录/概述)。\n","x-displayName":"概述"},{"name":"微信相关接口/API 列表","description":"","x-displayName":"API 列表"},{"name":"微信相关接口/事件","description":"","x-displayName":"事件"},{"name":"公开信息端点/API 列表","description":"","x-displayName":"API 列表"},{"name":"公开信息端点/事件","description":"","x-displayName":"事件"},{"name":"常见问题/常见问题","description":"### 1. 为什么我使用 Hoopscotch 调试时提示 \"Invalid signature received, please check documentation.\" ?\n\n这是因为 Hoopscotch 请求时无法携带 date 请求头,导致服务器校验签名失败,请使用 `Postman`、 `ApiFox`、`curl` 等其他 API 调试工具进行调试。\n\n![](https://files.authing.co/api-explorer/hoopscotch.jpg)\n","x-displayName":"常见问题"},{"name":"工具与资源/Quick Start","description":"Authing 针对不同的应用类型和开发语言,为开发者提供了对应的快速开始文档,详情请阅读[快速开始文档](https://docs.authing.cn/v2/quickstarts/)。\n","x-displayName":"Quick Start"},{"name":"工具与资源/SDK 列表","description":"针对此部分 API,我们还提供了以下几种语言的 SDK,各个 SDK 的方法名、参数、返回值和 API 尽可能保持完全一致,可以帮助你更快集成:\n\n- [Java](https://docs.authing.cn/v3/reference/sdk/java/install.html)\n- [Node.js](https://docs.authing.cn/v3/reference/sdk/node/install.html)\n- [Golang](https://docs.authing.cn/v3/reference/sdk/go/install.html)\n- [Python](https://docs.authing.cn/v3/reference/sdk/python/install.html)\n- [PHP](https://docs.authing.cn/v3/reference/sdk/php/install.html)\n- [C#](https://docs.authing.cn/v3/reference/sdk/csharp/install.html)\n","x-displayName":"SDK 列表"},{"name":"工具与资源/使用文档","description":"如果你想了解 Authing 整体的功能介绍,请见[使用指南文档](https://docs.authing.cn/v2/guides/)。\n","x-displayName":"使用文档"},{"name":"工具与资源/获取帮助","description":"如果你有任何问题,欢迎在 [Authing 论坛](https://forum.authing.cn/)中提出你的问题。\n","x-displayName":"获取帮助"},{"name":"事件概述/背景","description":"Authing 3.0 是以事件驱动(EDA)架构重塑的云原生身份平台,我们通过事件驱动架构大幅提升了平台的响应速度、可扩展性和开发者体验,并能够实现更加及时的安全事件响应和更加卓越的客户体验。\nAuthing 作为领先的 IDaaS 身份云厂商再次为行业带来变革,并为客户再一次降低身份场景下业务打通和数据集成的难度,并有效提升了企业的 IT 建设在身份云场景的投入回报。\n使用 Authing 的事件相关 SDK,开发者可以订阅 Authing 平台产生的事件,当事件发生时,Authing 服务会实时把事件的类型及当前事件关联的数据以 WebSocket 方式以 JSON 的数据格式主动推送给开发者。也可以在 Authing 控制台添加自定义事件,然后使用事件 SDK 向 Authing 服务推送自定义事件,用来触发特定的工作流程。式将事件内容以 JSON 格式进行推送。\n\n> - 事件订阅可以让你的应用及时响应 Authing 里的动作,从而实现业务的高度自定义改造。\n> - 事件发布可以让 Authing 的部分服务在自定义条件下触发特定操作,间接实现「改造」Authing 业务逻辑的能力。\n","x-displayName":"背景"},{"name":"事件概述/使用场景","description":"# 场景一: 构建实时用户分析控制台\n<img src=\"https://files.authing.co/api-explorer/event/1.png\" alt=\"drawing\" />\n<center>(通过订阅 Event 选择性、实时广播式更新数字,而非通过轮询/Long Poll)</center>\n\n# 场景二:在组织架构或员工信息变动时实时同步给下游应用(互操作),同步完成后给特定的用户开通邮箱\n<img src=\"https://files.authing.co/api-explorer/event/2.png\" alt=\"drawing\" />\n<center>(通过订阅 Event 单点式进行推送通知,而非通过轮询/Long Poll)</center>\n\n\n# 场景三:在任意用户登录时记录登录信息,反写到自有日志数据库中\n```javascript\nevent.sub('authing.user.login', async (userInfo) => {\n mysql.write(userInfo);\n})\n```\n\n# 场景四:当用户离职时,应用需要第一时间处理离职用户的业务数据\n```javascript\nevent.sub('authing.user.resigned', async (userInfo) => {\n doSomeThing(userInfo);\n})\n```\n\n# 场景五:当用户注销给管理员提醒\n```javascript\nevent.sub('authing.user.delete-account', async (userInfo) => {\n doSomeThing(userInfo);\n})\n```\n\n# 场景六:非组织类数据同步与响应\n<img src=\"https://files.authing.co/api-explorer/event/4.png\" alt=\"drawing\" />\n\n# 场景七: MFA 持续自适应认证\n<img src=\"https://files.authing.co/api-explorer/event/5.png\" alt=\"drawing\" />\n\n# 场景八:审计日志\n<img src=\"https://files.authing.co/api-explorer/event/6.png\" alt=\"drawing\" />\n\n> - 以上是八个简单的使用场景,开发者可以根据不同需求,在 Authing 订阅不同事件\n> - 可以在 Authing API Explorer 查找所有公开的事件","x-displayName":"使用场景"},{"name":"事件概述/管理端 SDK 订阅事件流程","description":"# 一、订阅系统公共事件步骤\n1. 在 [Authing 控制台](https://console.authing.cn/) 的**设置 -> 基础设置 -> 密钥管理**页面,可以获取到用户池 ID(UserPool Id)和用户池密钥(UserPool Secret),如下图所示:\n<img src=\"https://files.authing.co/api-explorer/event/7.png\" alt=\"drawing\" />\n\n1. 初始化 SDK\n```java\nManagementClientOptions clientOptions = new ManagementClientOptions();\nclientOptions.setAccessKeyId(ACCESS_KEY_ID); // 用户池 id\nclientOptions.setAccessKeySecret(ACCESS_KEY_SECRET); // 用户池密钥\n\nManagementClient client = new ManagementClient(clientOptions); // 初始化 sdk\n```\n\n¶ clientOptions 完整参数如下:\n- `accessKeyId`: Authing 用户池 ID 或者协作管理员的 Access Key ID。\n- `accessKeySecret`: Authing 用户池密钥或者协作管理员的 Access Key Secret。\n- `host`: Authing API 服务器地址,默认为 `https://api.authing.cn`。如果你使用的是 Authing 公有云版本,请忽略此参数。如果你使用的是私有化部署的版本,此参数必填,格式如下: `https://authing-api.my-authing-service.com`(最后不带斜杠 /)。\n- `timeout`: 请求超时时间,可选,单位为毫秒,默认为 10000(10 秒)。\n- `lang`: 接口 Message 返回语言格式(可选),可选值为 zh-CN、en-US、ja-JP 和 zh-TW,默认为 zh-CN。\n- `websocketHost`: Authing 事件 websocket 服务器地址,默认为 `wss://events.authing.com` 。如果你使用的是 Authing 公有云版本,请忽略此参数。如果你使用的是私有化部署的版本,此参数必填,格式如下: `wss://events.my-authing-service.com` (最后不带斜杠 /)。\n\n3. 订阅事件\n初始化完成 ManagementClient 之后,你可以获取 ManagementClient 的实例,然后调用此实例上的 `subEvent` 方法订阅所需的事件数据,如「用户注册时间」的订阅代码如下:\n```java\nclient.subEvent(\"authing.user.login\", new Receiver() { // 订阅用户注册事件\n @Override\n public void onReceiverMessage(String msg) {\n System.out.println(msg);\n }\n});\n```\n> 管理端 SDK 可以订阅当前用户池相关的公共事件和私有事件\n\n# 二、订阅用户池私有事件\n1. 在 Authing 控制台查看事先定义好的事件编码(参考 [通过控制台的自动化功能发布事件流程](#tag/事件概述/通过控制台的自动化功能发布事件流程))。\n2. 按照 订阅公共事件步骤 的 1、2 流程完成 SDK 初始化。\n3. 然后调用 SDK 的订阅方法,示例代码如下:\n```java\nclient.subEvent(\"custom_aouaw.myEvent\", new Receiver() { // 订阅用户注册事件\n @Override\n public void onReceiverMessage(String msg) {\n System.out.println(msg);\n }\n});\n```","x-displayName":"管理端 SDK 订阅事件流程"},{"name":"事件概述/管理端 SDK 发布事件流程","description":"若公共事件不能满足业务需要,当某些业务需要业务系统提供数据触发 Auhting 的身份自动化流程时,开发者可以提前在控制台定义好自定义事件,然后使用 sdk 推送业务系统的特定数据,来达到触发身份自动化编排流程,特定的业务行为,步骤如下:\n1. 在 [Authing 控制台](https://console.authing.cn) **自动化 -> 身份自动化 -> 创建工作流** 创建一个自动化工作流。\n<img src=\"https://files.authing.co/api-explorer/event/8.png\" alt=\"drawing\" style=\"max-width: 80%\" />\n\n2. 打开刚刚创建的自动化流程,在 **选择触发器 -> 通过应用事件触发 -> 自定义事件 -> 新增自定义事件** 页面填写自定义事件的名称和自定义编码,完成自定义事件的创建。\n<img src=\"https://files.authing.co/api-explorer/event/9.png\" alt=\"drawing\" style=\"max-width: 80%\" />\n\n> - 自定义编码整个用户池不能重复,且不允许使用 Authing 已经存在的事件编码。\n> - 管理端 SDK 仅能发布用户池已经定义好的私有事件,无法发布系统公共事件。\n\n1. 按照 订阅公共事件步骤 的 1、2 流程完成 SDK 初始化。\n2. 发布用户池私有事件\n```java\nString myEventData = \"{\\\"id\\\":\\\"myid\\\",\\\"createdAt\\\":1675579686427,\\\"updatedAt\\\":1675579686427}\";\nCostGetAllRightItemRespDto result = managementClient.pubtEvent(\"custom_aouaw.myEvent\", myEventData);\nSystem.out.println(result);\n```\nmanagementClient.pubtEvent 方法参数说明:\n- `eventCode` <String> 事件编码。\n- `data` <String> 事件体,json 格式。\n","x-displayName":"管理端 SDK 发布事件流程"},{"name":"事件概述/认证端 SDK 发布事件流程","description":"若终端用户需要接受事件,可通过客户端(如 iOS、Android、JavaScript 等) SDK 订阅所需事件,步骤如下:\n1. 免费创建一个 [Authing 帐号](https://www.authing.cn/)。\n2. 在 Authing 控制台[创建一个自建应用](https://docs.authing.cn/v2/guides/app-new/create-app/create-app.html)。在选择类型时请选择除`后端应用`外的其他应用。\n<img src=\"https://files.authing.co/api-explorer/event/10.png\" alt=\"drawing\" height=\"300\"/>\n\n3. 在 **应用 -> 自建应用 -> 应用配置** 页面查看应用的 appId 和 appSecret ,然后初始化客户端 SDK,JavaScript 代码如下:\n```javascript\nconst authentication = new AuthenticationClient({\n appId: \"AUTHING_APP_ID\",\n appSecret: \"AUTHING_APP_SECRET\",\n appHost: 'https://xxx.authing.cn',\n accessToken: \"ACCESS_TOKEN\"\n})\n```\n4. 发布自定义事件(参考 [通过控制台的自动化功能发布事件流程](#tag/事件概述/通过控制台的自动化功能发布事件流程))\n```javascript\ntry {\n const data = await authentication.pub(\"YOUR_CUSTOM_EVENT\", JSON.stringify({\n \"email\": \"test@example.com\",\n \"phone\": \"188xxxx8888\",\n \"name\": \"张三\",\n \"customData\": {\n \"school\": \"pku\",\n \"age\": 22\n },\n }))\n console.log(\"data: \", data);\n} catch (error) {\n console.log(\"error: \", error); \n}\n```\n> 认证端 SDK 仅可以发布用户池自定义的私有事件。\n","x-displayName":"认证端 SDK 发布事件流程"},{"name":"事件概述/认证端 SDK 订阅事件流程","description":"1. 参考 认证端 SDK 发布事件流程中的 1、2、3 步骤初始化 SDK\n2. 订阅所需事件\n\n```javascript\nauthentication.sub(\"authing.user.updated\", (source) => {\n console.log(\"source: \", source);\n}, (err) => {\n console.log(\"error: \", err);\n})\n```\n> 认证端 SDK 可以订阅当前用户相关的共有事件和用户池自定义的私有事件。","x-displayName":"认证端 SDK 订阅事件流程"},{"name":"事件概述/通过控制台的自动化功能发布事件流程","description":"1. 在 [Authing 控制台](https://console.authing.cn) **自动化 -> 身份自动化 -> 创建工作流** 创建一个自动化工作流。\n2. 配置好触发器之后,选择 **添加节点 -> 信息收发** 功能下选择 `发布事件` 节点(或者直接在搜索框通过关键词搜索 )。\n<img src=\"https://files.authing.co/api-explorer/event/11.png\" alt=\"drawing\" style=\"max-width: 80%\" />\n\n3. 填写需要发布的事件及数据源,并保存工作流。\n<img src=\"https://files.authing.co/api-explorer/event/12.png\" alt=\"drawing\" style=\"max-width: 80%\" />\n\n\n> 当工作流触发时会自动把配置中的数据发送到 Authing 事件中心,之后可以使用 SDK 订阅或者在工作流节点当做触发器使用。","x-displayName":"通过控制台的自动化功能发布事件流程"}],"servers":[],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"},"x-authing-app-id":{"type":"apiKey","in":"header","name":"x-authing-app-id","description":"Authing App Id"}},"schemas":{"FinishLoginParams":{"type":"object","properties":{}},"TokenEndPointParams":{"type":"object","properties":{"client_id":{"type":"string","description":"Authing 应用 ID,当换取 token 身份验证方式为 `client_secret_post` 或 `none` 时必填。","example":"62f733a7148xxxx8af1e5410"},"client_secret":{"type":"string","description":"Authing 应用密钥,当换取 token 身份验证方式为 `client_secret_post` 时必填。","example":"5e0e4d2277be57xxxx30f154648f7360"},"grant_type":{"type":"string","description":"授权模式:\n- `authorization_code`: 使用一次性授权码 `code` 换取。\n- `refresh_token`: 使用 Refresh Token 获取。\n- `client_credentials`: M2M 无用户交互场景使用。\n- `password`: 密码模式,使用用户的账号密码获取,不推荐使用。\n- `http://authing.cn/oidc/grant_type/authing_token`: 使用 Authing 历史版本签发的 Token 换取,不推荐使用。\n ","example":"authorization_code","enum":["authorization_code","refresh_token","client_credentials","password","http://authing.cn/oidc/grant_type/authing_token"]},"redirect_uri":{"type":"string","description":"发起 OIDC 授权登录时的 redirect_uri 值,必须与发起登录请求时的参数一致","example":"https://example.com/callback"},"code":{"type":"string","description":"获取到的一次性授权码,**一个 code 仅限一次性使用**,用后作废。有效期为 10 分钟。当 `grant_type` 为 `authorization_code` 时必填。","example":"SF1LMNF7oUeM1fEEX9NlMFeXLJiscE5o2ESJDYjqh1O"},"code_verifier":{"type":"string","description":"拼接 OIDC 授权登录连接时生成的随机字符串值,也就是 code_challenge 原始值,不是其摘要值。当使用**授权码 + PKCE 模式**时需要填写此参数。当 `grant_type` 为 `authorization_code` 并且使用 PKCE 模式时必填。","example":""},"refresh_token":{"type":"string","description":"用户的 Refresh Token。当 `grant_type` 为 `refresh_token` 时必填。","example":""}},"required":["grant_type","redirect_uri"]},"LoginTokenResponseDataDto":{"type":"object","properties":{"access_token":{"type":"string","description":"接口调用凭据,在限制时间内被授权访问资源 API","example":"eyJhbGciOiJSxxxxx"},"id_token":{"type":"string","description":"用户的身份凭证,解析后会包含用户信息","example":"eyJhbGxxxx"},"refresh_token":{"type":"string","description":"refresh_token 用于获取新的 AccessToken","example":"WPsGJbvpBjqXz6IJIr1UHKyrdVF"},"token_type":{"type":"string","description":"token 类型","example":"bearer"},"expire_in":{"type":"number","description":"过期时间 单位是秒","example":7200}},"required":["token_type","expire_in"]},"TokenIntrospectEndpointParams":{"type":"object","properties":{"client_id":{"type":"string","description":"Authing 应用 ID。当在控制台配置检验 token 身份验证方式为 client_secret_post 和 none 时必填。","example":"62f733a7148xxxx8af1e5410"},"client_secret":{"type":"string","description":"Authing 应用密钥。在控制台配置检验 token 身份验证方式为 client_secret_post 时必填。","example":"5e0e4d2277be57xxxx30f154648f7360"},"token":{"type":"string","description":"`access_token` 或者 `refresh_token` 的值","example":"xxxxx"}},"required":["token"]},"TokenIntrospectResponse":{"type":"object","properties":{"active":{"type":"boolean","description":"Token 是否有效","example":true},"sub":{"type":"string","description":"此 Token 对应的用户 ID,当 token 合法时返回。","example":""},"client_id":{"type":"string","description":"签发此 Token 的应用 ID,当 token 合法时返回。","example":""},"exp":{"type":"number","description":"Token 的到期时间,为单位为秒的时间戳。当 token 合法时返回。","example":1601460494},"iat":{"type":"number","description":"Token 的签发时间,为单位为秒的时间戳。当 token 合法时返回。","example":1601456894},"iss":{"type":"string","description":"Issuer,当 token 合法时返回。","example":"https://oidc1.authing.cn/oidc"},"jti":{"type":"string","description":"JTI,当 token 合法时返回。","example":"K5TYewNhvdGBdHiRifMyW"},"scope":{"type":"string","description":"使用逗号分割的 scope 数组,当 token 合法时返回。","example":"openid profile email phone"},"token_type":{"type":"string","description":"Token Type,默认为 Bearer,当 token 合法时返回。","example":"Bearer"}},"required":["active"]},"TokenRevocationEndpointParams":{"type":"object","properties":{"client_id":{"type":"string","description":"Authing 应用 ID。当在控制台配置撤回 token 身份验证方式为 client_secret_post 和 none 时必填。","example":"62f733a7148xxxx8af1e5410"},"client_secret":{"type":"string","description":"Authing 应用密钥。在控制台配置撤回 token 身份验证方式为 client_secret_post 时必填。","example":"5e0e4d2277be57xxxx30f154648f7360"},"token":{"type":"string","description":"`access_token` 或者 `refresh_token` 的值","example":"xxxxx"}},"required":["token"]},"IsSuccessDto":{"type":"object","properties":{"success":{"type":"boolean","description":"操作是否成功","example":true}},"required":["success"]},"IsSuccessRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"操作是否成功","allOf":[{"$ref":"#/components/schemas/IsSuccessDto"}]}},"required":["statusCode","message","data"]},"MfaTokenIntrospectEndpointParams":{"type":"object","properties":{"token":{"type":"string","description":"`mfa_token` 的值","example":"xxxxx"}},"required":["token"]},"MfaTokenIntrospectResponse":{"type":"object","properties":{"active":{"type":"boolean","description":"Token 是否有效","example":true},"userPoolId":{"type":"string","description":"签发此 Token 的用户池 ID,当 token 合法时返回。","example":""},"userId":{"type":"string","description":"签发此 Token 的用户 ID,当 token 合法时返回。","example":""},"exp":{"type":"number","description":"Token 的到期时间,为单位为秒的时间戳。当 token 合法时返回。","example":1601460494},"iat":{"type":"number","description":"Token 的签发时间,为单位为秒的时间戳。当 token 合法时返回。","example":1601456894}},"required":["active"]},"OidcDiscoveryMetadata":{"type":"object","properties":{"issuer":{"type":"string","description":"OIDC Issuer","example":"https://oidc1.authing.cn/oidc"},"authorization_endpoint":{"type":"string","description":"OIDC 发起认证端点","example":"https://oidc1.authing.cn/oidc/auth"},"token_endpoint":{"type":"string","description":"OIDC 获取 Token 端点","example":"https://oidc1.authing.cn/oidc/token"},"userinfo_endpoint":{"type":"string","description":"OIDC 获取用户信息端点","example":"https://oidc1.authing.cn/oidc/me"},"jwks_uri":{"type":"string","description":"OIDC JWKS 端点","example":"https://oidc1.authing.cn/oidc/.well-known/jwks.json"},"scopes_supported":{"description":"此 OIDC IDP 支持的所有 Scope 列表","example":["openid","offline_access","username","phone","email","address","profile","role","roles","unionid","external_id","extended_fields","tenant_id","userpool_id"],"default":["openid","offline_access","username","phone","email","address","profile","role","roles","unionid","external_id","extended_fields","tenant_id","userpool_id"],"type":"array","items":{"type":"string"}},"response_types_supported":{"type":"array","description":"此 OIDC IDP 支持的所有返回类型","items":{"type":"string","enum":["none","code","token","id_token token","id_token","code token","code id_token token","code id_token"]}},"response_modes_supported":{"description":"此 OIDC IDP 支持的所有 Response Mode","example":["query","fragment","form_post","web_message"],"type":"array","items":{"type":"string"}},"grant_types_supported":{"description":"此 OIDC IDP 支持的所有 Grant Types","type":"array","items":{"type":"string"}},"id_token_signing_alg_values_supported":{"description":"此 OIDC IDP 支持的所有 ID Token 签名方式","example":["HS256","RS256"],"type":"array","items":{"type":"string"}},"id_token_encryption_alg_values_supported":{"description":"此 OIDC IDP 支持的所有 ID Token 加密方式","example":["A128KW","A256KW","ECDH-ES","ECDH-ES+A128KW","ECDH-ES+A256KW","RSA-OAEP"],"type":"array","items":{"type":"string"}},"id_token_encryption_enc_values_supported":{"example":["A128CBC-HS256","A128GCM","A256CBC-HS512","A256GCM"],"type":"array","items":{"type":"string"}},"userinfo_signing_alg_values_supported":{"description":"此 OIDC IDP 支持的所有用户信息签名方式","example":["HS256","RS256"],"type":"array","items":{"type":"string"}},"userinfo_encryption_alg_values_supported":{"description":"此 OIDC IDP 支持的所有用户信息加密方式","example":["A128KW","A256KW","ECDH-ES","ECDH-ES+A128KW","ECDH-ES+A256KW","RSA-OAEP"],"type":"array","items":{"type":"string"}},"userinfo_encryption_enc_values_supported":{"example":["A128CBC-HS256","A128GCM","A256CBC-HS512","A256GCM"],"type":"array","items":{"type":"string"}},"token_endpoint_auth_methods_supported":{"description":"此 OIDC IDP 支持的所有获取 Token 的认证方式","example":["client_secret_post","client_secret_basic","none"],"type":"array","items":{"type":"string"}},"claim_types_supported":{"description":"此 OIDC IDP 支持的所有 Claim Type","example":["normal"],"type":"array","items":{"type":"string"}},"claims_supported":{"description":"此 OIDC IDP 支持的所有 Claim","example":["sub","username","phone_number","phone_number_verified","email","email_verified","address","birthdate","family_name","gender","given_name","locale","middle_name","name","nickname","picture","preferred_username","profile","updated_at","website","zoneinfo","role","roles","unionid","external_id","extended_fields","tenant_id","userpool_id","sid","auth_time","iss"],"type":"array","items":{"type":"string"}},"code_challenge_methods_supported":{"description":"此 OIDC IDP 支持的所有 Code Challenge 模式","example":["plain","S256"],"type":"array","items":{"type":"string"}},"end_session_endpoint":{"type":"string","description":"此 OIDC IDP 的前端登出端点","example":"https://oidc1.authing.cn/oidc/session/end"},"introspection_endpoint":{"type":"string","description":"此 OIDC IDP 的检查 Token 状态端点","example":"https://oidc1.authing.cn/oidc/token/introspection"},"introspection_endpoint_auth_methods_supported":{"description":"此 OIDC IDP 检查 Token 状态端点支持的所有验证方式","example":["client_secret_post","client_secret_basic","none"],"type":"array","items":{"type":"string"}},"revocation_endpoint":{"type":"string","description":"此 OIDC IDP 的撤销 Token 端点","example":"https://oidc1.authing.cn/oidc/token/revocation"},"revocation_endpoint_auth_methods_supported":{"description":"此 OIDC IDP 撤销 Token 端点支持的所有验证方式","example":["client_secret_post","client_secret_basic","none"],"type":"array","items":{"type":"string"}}},"required":["issuer","authorization_endpoint","token_endpoint","userinfo_endpoint","jwks_uri","scopes_supported","response_types_supported","response_modes_supported","grant_types_supported","id_token_signing_alg_values_supported","id_token_encryption_alg_values_supported","id_token_encryption_enc_values_supported","userinfo_signing_alg_values_supported","userinfo_encryption_alg_values_supported","userinfo_encryption_enc_values_supported","token_endpoint_auth_methods_supported","claim_types_supported","claims_supported","code_challenge_methods_supported","end_session_endpoint","introspection_endpoint","introspection_endpoint_auth_methods_supported","revocation_endpoint","revocation_endpoint_auth_methods_supported"]},"ValidatePEMKeyDto":{"type":"object","properties":{}},"SignUpByPasswordDto":{"type":"object","properties":{"password":{"type":"string","description":"用户密码,默认不加密。Authing 所有 API 均通过 HTTPS 协议对密码进行安全传输,可以在一定程度上保证安全性。\n如果你还需要更高级别的安全性,我们还支持 `RSA256` 和国密 `SM2` 的密码加密方式。详情见可选参数 `options.passwordEncryptType`。\n","example":"passw0rd"},"username":{"type":"string","description":"用户名","example":"test"},"email":{"type":"string","description":"邮箱,不区分大小写。","example":"test@example.com"}},"required":["password"]},"SignUpByPassCodeDto":{"type":"object","properties":{"passCode":{"type":"string","description":"一次性临时验证码,你需要先调用发送短信或者发送邮件接口获取验证码。","example":"123456"},"email":{"type":"string","description":"邮箱,不区分大小写。","example":"114114"},"phone":{"type":"string","description":"手机号","example":"188xxxx8888"},"phoneCountryCode":{"type":"string","description":"手机区号,中国大陆手机号可不填。Authing 短信服务暂不内置支持国际手机号,你需要在 Authing 控制台配置对应的国际短信服务。完整的手机区号列表可参阅 https://en.wikipedia.org/wiki/List_of_country_calling_codes。","example":"+86","default":"+86"}},"required":["passCode"]},"SignUpProfileDto":{"type":"object","properties":{"nickname":{"type":"string","description":"昵称","example":""},"company":{"type":"string","description":"公司","example":"Authing .Inc"},"photo":{"type":"string","description":"头像","example":"https://authing.cn/demo.jpg"},"device":{"type":"string","description":"设备","example":"iOS"},"browser":{"type":"string","description":"浏览器","example":"Edge"},"name":{"type":"string","description":"名称","example":"Mike"},"givenName":{"type":"string","description":"名","example":"Zhou"},"familyName":{"type":"string","description":"姓","example":"Jay"},"middleName":{"type":"string","description":"中间名","example":"Jane"},"profile":{"type":"string","description":"资料","example":"this is my profile"},"preferredUsername":{"type":"string","description":"希望称呼的用户名","example":"Mike"},"website":{"type":"string","description":"网站","example":"https://authing.cn"},"gender":{"type":"string","description":"性别 W : 女性; M : 男性","enum":["M","F","U"],"example":"M"},"birthdate":{"type":"string","description":"生日","example":"2020.2.2"},"zoneinfo":{"type":"string","description":"地区","example":"HongKong"},"locale":{"type":"string","description":"语言地区","example":"EN-US"},"address":{"type":"string","description":"地址","example":"Hai Dian XX"},"formatted":{"type":"string","description":"格式","example":""},"streetAddress":{"type":"string","description":"街道地址","example":"Hai Dian Street 1"},"locality":{"type":"string","description":"位置","example":"BeiJing HaiDian"},"region":{"type":"string","description":"地区","example":"china"},"postalCode":{"type":"string","description":"邮政编码","example":"3500000"},"country":{"type":"string","description":"国家","example":"china"},"email":{"type":"string","description":"用户邮箱。如果要补全邮箱,必须在 `options.emailPassCodeForInformationCompletion` 传入邮箱验证码。发送邮箱验证码可以使用 /api/v3/send-email 接口。","example":"help@authing.cn"},"phone":{"type":"string","description":"用户手机号。如果要补全手机号,必须在 `options.phonePassCodeForInformationCompletion` 传入手机号验证码。发送手机号验证码可以使用 /api/v3/send-sms 接口。","example":"114114114"},"customData":{"type":"object","description":"用户自定义字段","example":{"name":"H"}}}},"SignUpOptionsDto":{"type":"object","properties":{"clientIp":{"type":"string","description":"客户端 IP","example":"192.168.0.1"},"phonePassCodeForInformationCompletion":{"type":"string","description":"用于注册时补全用户信息的短信验证码","example":"1234"},"emailPassCodeForInformationCompletion":{"type":"string","description":"用于注册时验证用户的邮箱验证码","example":"1234"},"context":{"type":"object","description":"登录/注册时传的额外参数,会存到用户自定义字段里面"},"passwordEncryptType":{"type":"string","description":"密码加密类型,支持使用 RSA256 和国密 SM2 算法进行加密。默认为 `none` 不加密。\n- `none`: 不对密码进行加密,使用明文进行传输。\n- `rsa`: 使用 RSA256 算法对密码进行加密,需要使用 Authing 服务的 RSA 公钥进行加密,请阅读**介绍**部分了解如何获取 Authing 服务的 RSA256 公钥。\n- `sm2`: 使用 [国密 SM2 算法](https://baike.baidu.com/item/SM2/15081831) 对密码进行加密,需要使用 Authing 服务的 SM2 公钥进行加密,请阅读**介绍**部分了解如何获取 Authing 服务的 SM2 公钥。\n ","enum":["sm2","rsa","none"],"example":"none","default":"none"}},"required":["context"]},"SignUpDto":{"type":"object","properties":{"connection":{"type":"string","description":"注册方式:\n- `PASSWORD`: 邮箱密码方式\n- `PASSCODE`: 邮箱/手机号验证码方式\n ","enum":["PASSWORD","PASSCODE"],"example":"PASSWORD"},"passwordPayload":{"description":"当注册方式为 `PASSWORD` 时此参数必填。","example":{"email":"test@example.com","password":"passw0rd"},"allOf":[{"$ref":"#/components/schemas/SignUpByPasswordDto"}]},"passCodePayload":{"description":"当认证方式为 `PASSCODE` 时此参数必填","example":{"email":"test@example.com","passCode":"passw0rd"},"allOf":[{"$ref":"#/components/schemas/SignUpByPassCodeDto"}]},"profile":{"description":"用户资料","allOf":[{"$ref":"#/components/schemas/SignUpProfileDto"}]},"options":{"description":"可选参数","allOf":[{"$ref":"#/components/schemas/SignUpOptionsDto"}]}},"required":["connection"]},"IdentityDto":{"type":"object","properties":{"identityId":{"type":"string","description":"身份源 ID","example":"62299d8b866d2dab79a89dc4"},"extIdpId":{"type":"string","description":"身份源连接 ID","example":"6076bacxxxxxxxxd80d993b5"},"provider":{"type":"string","description":"外部身份源类型:\n- `wechat`: 微信\n- `qq`: QQ\n- `wechatwork`: 企业微信\n- `dingtalk`: 钉钉\n- `weibo`: 微博\n- `github`: GitHub\n- `alipay`: 支付宝\n- `baidu`: 百度\n- `lark`: 飞书\n- `welink`: Welink\n- `yidun`: 网易易盾\n- `qingcloud`: 青云\n- `google`: Google\n- `gitlab`: GitLab\n- `gitee`: Gitee\n- `twitter`: Twitter\n- `facebook`: Facebook\n- `slack`: Slack\n- `linkedin`: Linkedin\n- `instagram`: Instagram\n- `oidc`: OIDC 型企业身份源\n- `oauth2`: OAuth2 型企业身份源\n- `saml`: SAML 型企业身份源\n- `ldap`: LDAP 型企业身份源\n- `ad`: AD 型企业身份源\n- `cas`: CAS 型企业身份源\n- `azure-ad`: Azure AD 型企业身份源\n ","enum":["oidc","oauth2","saml","ldap","ad","cas","azure-ad","wechat","google","qq","wechatwork","dingtalk","weibo","github","alipay","apple","baidu","lark","gitlab","twitter","facebook","slack","linkedin","yidun","qingcloud","gitee","instagram","welink","huawei","honor","xiaomi","oppo","aws","amazon","douyin","kuaishou","line","sdbz"],"example":"wechat"},"type":{"type":"string","description":"Identity 类型,如 unionid, openid, primary","example":"openid"},"userIdInIdp":{"type":"string","description":"在外部身份源中的 ID","example":"oj7Nq05R-RRaqak0_YlMLnnIwsvg"},"userInfoInIdp":{"type":"object","description":"用户在 idp 中的身份信息"},"accessToken":{"type":"string","description":"在外部身份源中的 Access Token(此参数只会在用户主动获取时返回,管理侧接口不会返回)。","example":"57_fK0xgSL_NwVlS-gmUwlMQ2N6AONNIOAYxxxx"},"refreshToken":{"type":"string","description":"在外部身份源中的 Refresh Token(此参数只会在用户主动获取时返回,管理侧接口不会返回)。","example":"57_IZFu91Ak1Wg6DRytZFFIOd3upNF5lH7vPxxxxx"},"originConnIds":{"description":"身份来自的身份源连接 ID 列表","example":["605492ac41xxxxe0362f0707"],"type":"array","items":{"type":"string"}}},"required":["identityId","extIdpId","provider","type","userIdInIdp","userInfoInIdp","originConnIds"]},"UserDto":{"type":"object","properties":{"userId":{"type":"string","description":"用户的唯一标志,可以是用户 ID、用户名、邮箱、手机号、externalId、在外部身份源的 ID,详情见 userIdType 字段的说明。默认为用户 id 。","example":"6229ffaxxxxxxxxcade3e3d9"},"createdAt":{"format":"date-time","type":"string","description":"创建时间","example":"2022-07-03T02:20:30.000Z"},"updatedAt":{"format":"date-time","type":"string","description":"更新时间","example":"2022-07-03T02:20:30.000Z"},"status":{"type":"string","description":"账户当前状态","enum":["Suspended","Resigned","Activated","Archived","Deactivated"],"example":"Activated"},"workStatus":{"type":"string","description":"账户当前工作状态","enum":["Closed","Active"],"example":"Active"},"externalId":{"type":"string","description":"第三方外部 ID","example":"10010"},"email":{"type":"string","description":"邮箱,不区分大小写","example":"test@example.com"},"phone":{"type":"string","description":"手机号,不带区号。如果是国外手机号,请在 phoneCountryCode 参数中指定区号。","example":"188xxxx8888"},"phoneCountryCode":{"type":"string","description":"手机区号,中国大陆手机号可不填。Authing 短信服务暂不内置支持国际手机号,你需要在 Authing 控制台配置对应的国际短信服务。完整的手机区号列表可参阅 https://en.wikipedia.org/wiki/List_of_country_calling_codes。","example":"+86"},"username":{"type":"string","description":"用户名,用户池内唯一","example":"bob"},"name":{"type":"string","description":"用户真实名称,不具备唯一性","example":"张三"},"nickname":{"type":"string","description":"昵称","example":"张三"},"photo":{"type":"string","description":"头像链接","example":"https://files.authing.co/authing-console/default-user-avatar.png"},"loginsCount":{"type":"number","description":"历史总登录次数","example":3},"lastLogin":{"format":"date-time","type":"string","description":"上次登录时间","example":"2022-07-03T02:20:30.000Z"},"lastIp":{"type":"string","description":"上次登录 IP","example":"127.0.0.1"},"gender":{"type":"string","description":"性别:\n- `M`: 男性,`male`\n- `F`: 女性,`female`\n- `U`: 未知,`unknown`\n ","enum":["M","F","U"],"example":"M"},"emailVerified":{"type":"boolean","description":"邮箱是否验证","example":true},"phoneVerified":{"type":"boolean","description":"手机号是否验证","example":true},"passwordLastSetAt":{"format":"date-time","type":"string","description":"用户上次密码修改时间","example":"2022-07-03T02:20:30.000Z"},"birthdate":{"format":"date-time","type":"string","description":"出生日期","example":"2022-06-03"},"country":{"type":"string","description":"所在国家","example":"CN"},"province":{"type":"string","description":"所在省份","example":"BJ"},"city":{"type":"string","description":"所在城市","example":"BJ"},"address":{"type":"string","description":"所处地址","example":"北京朝阳"},"streetAddress":{"type":"string","description":"所处街道地址","example":"北京朝阳区 xxx 街道"},"postalCode":{"type":"string","description":"邮政编码号","example":"438100"},"company":{"type":"string","description":"所在公司","example":"steamory"},"browser":{"type":"string","description":"最近一次登录时使用的浏览器 UA","example":"Mozilla/5.0 (Linux; Android 10; V2001A; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/87.0.4280.141 Mobile Safari/537.36 VivoBrowser/10.2.10.0"},"device":{"type":"string","description":"最近一次登录时使用的设备","example":"iOS"},"givenName":{"type":"string","description":"名","example":"三"},"familyName":{"type":"string","description":"姓","example":"张"},"middleName":{"type":"string","description":"中间名","example":"James"},"profile":{"type":"string","description":"Preferred Username","example":"alice"},"preferredUsername":{"type":"string","description":"Preferred Username","example":"alice"},"website":{"type":"string","description":"用户个人网页","example":"https://my-website.com"},"zoneinfo":{"type":"string","description":"用户时区信息","example":"GMT-08:00"},"locale":{"type":"string","description":"Locale","example":"af"},"formatted":{"type":"string","description":"标准的完整地址","example":"132, My Street, Kingston, New York 12401."},"region":{"type":"string","description":"用户所在区域","example":"Xinjiang Uyghur Autonomous Region"},"userSourceType":{"type":"string","description":"来源类型:\n- `excel`: 通过 excel 导入\n- `register`: 用户自主注册\n- `adminCreated`: 管理员后台手动创建(包含使用管理 API 创建用户 )\n- `syncTask`: 同步中心的同步任务 \n","enum":["excel","register","adminCreated","sync"],"example":"register"},"userSourceId":{"type":"string","description":"应用 ID 或者同步任务 ID","example":""},"lastLoginApp":{"type":"string","description":"用户上次登录的应用 ID","example":""},"mainDepartmentId":{"type":"string","description":"用户主部门 ID","example":""},"lastMfaTime":{"format":"date-time","type":"string","description":"用户上次进行 MFA 认证的时间","example":""},"passwordSecurityLevel":{"type":"number","description":"用户密码安全强度等级","example":1},"resetPasswordOnNextLogin":{"type":"boolean","description":"下次登录要求重置密码","default":false},"registerSource":{"description":"注册方式","type":"array","items":{"type":"string"}},"departmentIds":{"description":"用户所属部门 ID 列表","example":["624d930c3xxxx5c08dd4986e","624d93102xxxx012f33cd2fe"],"type":"array","items":{"type":"string"}},"identities":{"description":"外部身份源","type":"array","items":{"$ref":"#/components/schemas/IdentityDto"}},"identityNumber":{"type":"string","description":"用户身份证号码","example":"420421xxxxxxxx1234"},"customData":{"type":"object","description":"用户的扩展字段数据","example":{"school":"北京大学","age":22}},"postIdList":{"description":"用户关联的部门 Id","type":"array","items":{"type":"string"}},"statusChangedAt":{"format":"date-time","type":"string","description":"用户状态上次修改时间","example":"2022-07-03T02:20:30.000Z"},"tenantId":{"type":"string","description":"用户租户 ID","example":""}},"required":["userId","createdAt","updatedAt","status","workStatus","gender","emailVerified","phoneVerified","userSourceType"]},"UserSingleRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/UserDto"}]}},"required":["statusCode","message","data"]},"FactorProfile":{"type":"object","properties":{"phoneNumber":{"type":"string","description":"当发起绑定手机短信认证要素时,此参数必传。需要传递用户希望绑定的手机号。Authing 服务器会向此手机号发送短信验证码,要求用户在绑定 MFA 阶段提供验证码。一个手机号在一分钟内只能请求一次。","example":"188xxxx8888"},"phoneCountryCode":{"type":"string","description":"当发起绑定手机短信认证要素且需要绑定国际手机号时可以设置,默认为 +86,中国大陆手机区号。Authing 短信服务暂不内置支持国际手机号,你需要在 Authing 控制台配置对应的国际短信服务。完整的手机区号列表可参阅 https://en.wikipedia.org/wiki/List_of_country_calling_codes。","example":"+86"},"email":{"type":"string","description":"当发起绑定邮箱验证码认证要素时,此参数必传。需要传递用户希望绑定的邮箱。Authing 服务器会向此邮箱发送邮箱验证码,要求用户在绑定 MFA 阶段提供验证码。一个邮箱在一分钟内只能请求一次。","example":"test@example.com"}}},"SendEnrollFactorRequestDto":{"type":"object","properties":{"factorType":{"type":"string","description":"MFA 认证要素类型:\n- `OTP`: OTP\n- `SMS`: 短信\n- `EMAIL`: 邮件\n- `FACE`: 人脸\n ","enum":["OTP","SMS","EMAIL","FACE"],"example":"SMS"},"profile":{"description":"MFA 认证要素详细信息","example":{"phoneNumber":"188xxxx8888","phoneCountryCode":"+86"},"allOf":[{"$ref":"#/components/schemas/FactorProfile"}]}},"required":["factorType","profile"]},"SendEnrollFactorRequestOtpDataDto":{"type":"object","properties":{"qrCodeUri":{"type":"string","description":"OTP Auth Uri","example":"otpauth://totp/userPoolName:test?secret=xxxx&period=30&digits=6&algorithm=SHA1&issuer=userPoolName"},"qrCodeDataUrl":{"type":"string","description":"Base64 编码的 OTP 二维码,前端可以用此渲染二维码。","example":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOQAAADkCAYAAACIV4iNAAAAAklEQVR4AewaftIAAAxSSURBVO3BQW4ERxLAQLKh/3+Z62OeCmjMSC4vMsL+wVrrCg9rrWs8rLWu8bDWusbDWusaD2utazysta7xsNa6xsNa6xoPa61rPKy1rvGw1rrGw1rrGg9rrWs8rLWu8bDWusYPH1L5SxWTyknFJ1SmihOVqeINlU9UnKhMFZPKJyo+oTJVnKhMFZPKX6r4xMNa6xoPa61rPKy1rvHDl1V8k8obFZPKVPEJlW9SeaNiUplUpoqpYlKZKk5Upoo3VKaKE5VvqvgmlW96WGtd42GtdY2HtdY1fvhlKm9UvFExqZyoTBVvVJyonKicVEwqk8pJxSdU3lA5qZgqJpWTiknlm1TeqPhND2utazysta7xsNa6xg//cSqfUDmpOFGZKiaVqeKNihOVE5WpYqo4UTmpOFGZKqaKSeWNiv8nD2utazysta7xsNa6xg//cRUnKicVk8qkMlVMFW+oTBUnKm+onKicVEwVk8o3qbxR8f/sYa11jYe11jUe1lrX+OGXVfwllW+qmFROKt5QeaPiDZWpYlI5UTlROal4o2JSmSq+qeImD2utazysta7xsNa6xg9fpvKXVKaKSWWqmFSmikllqphU3qiYVKaKSeVEZar4TRWTylQxqUwV36QyVZyo3OxhrXWNh7XWNR7WWtf44UMVN1GZKt5Q+YTKicpU8YmKT1ScVEwqb1RMKlPFpDJVTCpvVPyXPKy1rvGw1rrGw1rrGj98SGWqmFROKiaVNyomlROVqeITFd+kcqLyTSpvVJyoTBXfVPGGylRxojJVTConFZ94WGtd42GtdY2HtdY1fvhQxaQyVUwqJxVvqPwllaniEyonFb+pYlJ5Q2WqmFR+k8pJxaQyVdzkYa11jYe11jUe1lrXsH/wAZWpYlL5SxWTyknFpDJVnKhMFScqU8WJylTxhspJxaQyVUwqn6h4Q2WqmFT+UsWkMlV84mGtdY2HtdY1HtZa17B/8ItUporfpDJVTConFZPKScWk8omKSWWqOFF5o+I3qXyi4g2VqeJEZar4Nz2sta7xsNa6xsNa6xo/XE7ljYqTikllUjmpmFSmikllqjhRmSomlZOKSeVE5aTiJipTxVQxqZxUTCpTxaRyUvGJh7XWNR7WWtd4WGtd44cvU5kqJpU3KiaVE5WTipOKSeU3qUwVk8obKlPFicpfqnhDZaqYVKaKqWJSOamYVKaKSeWbHtZa13hYa13jYa11jR/+WMWkMlVMKlPFpHJSMalMFZPKJ1SmikllqnijYlKZKiaVk4pJZVKZKiaVv6TyhsqJyknFpDJVfNPDWusaD2utazysta5h/+CLVE4qJpWTiknlpOJE5aRiUjmp+E0qJxVvqEwVb6hMFZPKGxVvqJxUvKHyiYpvelhrXeNhrXWNh7XWNX74sopvUpkqTlSmiqliUplUpopPqLxRcVIxqZxUvKEyVfwmlaliUpkqJpUTlU9UnKhMFZ94WGtd42GtdY2HtdY1fviQylQxqUwVb1ScqPwllZOKT6icqJxUnFScVJxUfKLijYqTijcqJpUTlaniNz2sta7xsNa6xsNa6xo//MsqJpVJZao4qXij4ptUPlHxTSpTxaQyVUwqU8UbFScqU8Wk8kbFicobFX/pYa11jYe11jUe1lrX+OFDFZPKJypOVD6hclLxRsWJylTxCZWTiqniN6m8oTJVTCpvVEwqb1RMKv+mh7XWNR7WWtd4WGtd44cPqbyhclIxqUwVb6icVEwqJxWfUDmpmFR+U8WkMlVMKlPFpDKpfKLimypu9rDWusbDWusaD2uta9g/+EUqU8WkclIxqUwVb6icVEwqb1R8QuWkYlI5qThR+aaKE5WpYlKZKiaVqeJE5aTiDZWp4pse1lrXeFhrXeNhrXWNH75MZar4hMqJyhsVk8obFScqJxWTylQxqUwqb6hMFScVk8pUMal8QmWqeEPlEypTxaTylx7WWtd4WGtd42GtdY0fvqziROWk4g2Vk4qTipOKSeWNikllqnij4g2VT1RMKicqn1CZKt6oeENlUpkqJpXf9LDWusbDWusaD2uta/zwIZU3KiaVE5Wp4g2VqeKbKk5UpopvUpkqTlSmikllqpgq3lCZKiaVqeKkYlI5UZkqPlExqUwVn3hYa13jYa11jYe11jV++FDFpDJVTCpvVLxRcaJyUvGGylQxVZyoTBVvVLxRMalMFZPKScVJxRsqU8Wk8kbFGxX/poe11jUe1lrXeFhrXeOHD6l8k8o3qZxUnKhMFZPKpDJVfJPKb1KZKt5QmSomlaliUvmEyidUpopJ5Tc9rLWu8bDWusbDWusaP3yoYlKZVE4q3lCZKiaVqWJSOVGZKk4q3lB5o+INlROVqeI3qUwVJxVvVLyhMlVMKv+mh7XWNR7WWtd4WGtd44dfVjGpnKicVEwqU8Wk8k0qU8WkMlVMFZPKGypTxVTxhspUMal8omJSmSomlaliqjhRmSreqJhUTiq+6WGtdY2HtdY1HtZa1/jhyyomlaliUjmp+C9TmSqmikllqpgqJpU3KqaKSWWqeEPlpOITKp+o+ETFpDJVfOJhrXWNh7XWNR7WWtf44UMqU8VU8QmVqeKbVP6SylTxhspUMalMFScqv0llqphUpopJZaqYVKaKE5WTiqliUvlND2utazysta7xsNa6xg8fqjhRmSreqPimiknljYo3Kk5U3qg4qfhNKr9JZao4qZhUpoqp4kTl3/Sw1rrGw1rrGg9rrWvYP/gilaliUjmpmFQ+UTGpfFPFpDJVTCpTxYnKScWkclLxhspU8QmVqeINlaniROWk4g2Vk4pPPKy1rvGw1rrGw1rrGj/8yyomlaliUvlNFScqJxXfVPFGxSdUTlSmiknlDZWp4t+kMlVMFb/pYa11jYe11jUe1lrX+OGXqUwVb6hMFW+onFS8UTGpnFS8ofKJikllqphU3qiYVN6omFS+SWWqmFROKk5UTio+8bDWusbDWusaD2uta/zwyyomlZOKN1Q+oTJVTConFZPKJyomlaliUvmmiknlExWTyhsqn1B5Q+Xf9LDWusbDWusaD2uta/zwIZWpYlKZKk5UTiq+qWJSOamYVE5UpooTlaniN1V8ouJEZaqYVCaVv6TyRsVvelhrXeNhrXWNh7XWNX74MpWp4kRlqjhRmSpOVD5RMalMFScqJyqfqJhUTlROKqaKSeVmFW+oTBWTyl96WGtd42GtdY2HtdY1fvhQxaTyRsWkclIxqUwVU8UnVN5QmSpOKiaVSWWqmFSmikllqphUTlROKiaVT1RMKlPFpDJVTCpTxVTxhspU8U0Pa61rPKy1rvGw1rrGD79M5aRiqnij4kRlqphUpooTlUllqnhD5b9MZao4UTlRmSpOKiaVE5Wp4qRiUplUpopPPKy1rvGw1rrGw1rrGj98SOWNijdUpopvqjhROamYVKaKk4oTlUnlROWNiknlpGJSOVGZKk5U3lD5hMpJxUnFNz2sta7xsNa6xsNa6xr2D/7DVKaKE5Wp4i+pnFRMKlPFGypTxaQyVZyofKJiUpkq3lCZKt5QmSreUJkqPvGw1rrGw1rrGg9rrWv88CGVv1RxojJVnKicVJyofKLiEypTxYnKGyonFW+o/CWVqeINlaliqvimh7XWNR7WWtd4WGtd44cvq/gmlTcqJpWp4kRlUpkqvkllqnij4o2KE5WTijdUpopJ5URlqnij4r/kYa11jYe11jUe1lrX+OGXqbxR8UbFpPKJihOVk4o3VCaVE5WbqLyhMlW8oXKi8gmVN1Smik88rLWu8bDWusbDWusaP/zHqUwVv6liUplU3qg4UZkqvkllqvhNFZPKScWJylQxqfyXPKy1rvGw1rrGw1rrGj/8n1GZKk5UTiomlaniDZXfpDJVnFR8omJSeaPiRGWqmCpOKiaVNyomlanimx7WWtd4WGtd42GtdY0fflnFb6qYVN6omFQmld+k8obKVDFVTConFZPKVDGpTBVTxaRyojJVTBVvqJxUvKEyVfymh7XWNR7WWtd4WGtd44cvU/lLKlPFpHJSMVW8oTJVfFPFicpJxYnKVDGpTBUnKlPFpDJVTConFZPKVPEJlaliUjmp+MTDWusaD2utazysta5h/2CtdYWHtdY1HtZa13hYa13jYa11jYe11jUe1lrXeFhrXeNhrXWNh7XWNR7WWtd4WGtd42GtdY2HtdY1HtZa13hYa13jf5JXo0uhVRYoAAAAAElFTkSuQmCC"},"recoveryCode":{"type":"string","description":"OTP Recovery Code","example":"e7ad-aaa4-da75-fa37-57d1-5141"}},"required":["qrCodeUri","qrCodeDataUrl","recoveryCode"]},"SendEnrollFactorRequestDataDto":{"type":"object","properties":{"enrollmentToken":{"type":"string","description":"临时凭证 enrollmentToken,有效时间为一分钟。在进行「绑定 MFA 认证要素」时,需要带上此参数。","example":"TQoCISidM0kBji0dxRi3afSDtkvvMiUphenIgLF87y+JOw4T8fDWOsHHXIcvZ2EVESXhTrfGyh1iGf52Cg9e9byeFQvm1VZ0QWrwmzwpntFAVtf1IP9LqVhmzXhBMFvLOcU/z1Eh/n0CrwX0uHNpJoMW9lp9AqHd9HvauaGKX+Y="},"otpData":{"description":"发起绑定 OTP 类型认证要素时,接口会返回此数据。","allOf":[{"$ref":"#/components/schemas/SendEnrollFactorRequestOtpDataDto"}]}},"required":["enrollmentToken"]},"SendEnrollFactorRequestRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/SendEnrollFactorRequestDataDto"}]}},"required":["statusCode","message","data"]},"EnrollFactorEnrollmentDataDto":{"type":"object","properties":{"passCode":{"type":"string","description":"绑定短信、邮箱验证码、OTP 类型的认证要素时,需要传此参数。值为短信/邮箱/OTP 验证码。","example":"123456"},"photo":{"type":"string","description":"绑定 FACE 类型的认证要素时,需要传此参数。值为绑定人脸图片链接。","example":"132434235ad244"},"isExternalPhoto":{"type":"boolean","description":"绑定 FACE 类型的认证要素时,需要传此参数。是否是外部链接图片。 ","example":true}}},"EnrollFactorDto":{"type":"object","properties":{"factorType":{"type":"string","description":"MFA 认证要素类型:\n- `OTP`: OTP\n- `SMS`: 短信\n- `EMAIL`: 邮件\n- `FACE`: 人脸\n ","enum":["OTP","SMS","EMAIL","FACE"],"example":"SMS"},"enrollmentToken":{"type":"string","description":"「发起绑定 MFA 认证要素请求」接口返回的 enrollmentToken,此 token 有效时间为一分钟。","example":"TQoCISidM0kBji0dxRi3afSDtkvvMiUphenIgLF87y+JOw4T8fDWOsHHXIcvZ2EVESXhTrfGyh1iGf52Cg9e9byeFQvm1VZ0QWrwmzwpntFAVtf1IP9LqVhmzXhBMFvLOcU/z1Eh/n0CrwX0uHNpJoMW9lp9AqHd9HvauaGKX+Y="},"enrollmentData":{"description":"绑定 MFA 认证要素时,对应认证要素要求的验证信息。","allOf":[{"$ref":"#/components/schemas/EnrollFactorEnrollmentDataDto"}]}},"required":["factorType","enrollmentToken","enrollmentData"]},"EnrollFactorRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"}},"required":["statusCode","message"]},"ResetFactorDto":{"type":"object","properties":{"factorId":{"type":"string","description":"MFA 认证要素 ID","example":"6229ffaxxxxxxxxcade3e3d9"}},"required":["factorId"]},"ResetFactorRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"}},"required":["statusCode","message"]},"FactorDto":{"type":"object","properties":{"factorId":{"type":"string","description":"MFA 认证要素ID","example":"6229ffaxxxxxxxxcade3e3d9"},"factorType":{"type":"string","description":"MFA 认证要素类型","enum":["OTP","SMS","EMAIL","FACE"],"example":"SMS"},"profile":{"type":"object","description":"MFA 认证要素信息","example":{"phoneNumber":"188xxxx8888","phoneCountryCode":"+86"}}},"required":["factorId","factorType","profile"]},"ListEnrolledFactorsRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"MFA Factor 列表","type":"array","items":{"$ref":"#/components/schemas/FactorDto"}}},"required":["statusCode","message","data"]},"GetFactorRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"MFA Factor 详情","allOf":[{"$ref":"#/components/schemas/FactorDto"}]}},"required":["statusCode","message","data"]},"FactorToEnrollDto":{"type":"object","properties":{"factorType":{"type":"string","description":"MFA Factor 类型","enum":["OTP","SMS","EMAIL","FACE"],"example":"SMS"}},"required":["factorType"]},"ListFactorsToEnrollRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"MFA Factor 列表","type":"array","items":{"$ref":"#/components/schemas/FactorToEnrollDto"}}},"required":["statusCode","message","data"]},"MfaOtpVerityDto":{"type":"object","properties":{"totp":{"type":"string","description":"OTP 口令","example":"612311"}},"required":["totp"]},"OtpVerityRespDto":{"type":"object","properties":{"verified":{"type":"boolean","description":"用户 OTP 校验是否成功","example":true}},"required":["verified"]},"MfaOtpVerityRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/OtpVerityRespDto"}]}},"required":["statusCode","message","data"]},"GenerateBindExtIdpLinkDataDto":{"type":"object","properties":{"url":{"type":"string","description":"用户绑定外部身份源的链接","example":""}},"required":["url"]},"GenerateBindExtIdpLinkRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/GenerateBindExtIdpLinkDataDto"}]}},"required":["statusCode","message","data"]},"UnlinkExtIdpDto":{"type":"object","properties":{"extIdpId":{"type":"string","description":"外部身份源 ID","example":"62f209327xxxxcc10d966ee5"}},"required":["extIdpId"]},"CommonResponseDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"}},"required":["statusCode","message"]},"GetIdentitiesRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"用户的身份源列表","type":"array","items":{"$ref":"#/components/schemas/IdentityDto"}}},"required":["statusCode","message","data"]},"ExtIdpInfoDto":{"type":"object","properties":{"identifier":{"type":"string","description":"身份源连接唯一标志","example":"wechat"},"extIdpId":{"type":"string","description":"身份源 ID"},"type":{"type":"string","description":"身份源类型","enum":["oidc","oauth2","saml","ldap","ad","cas","azure-ad","wechat","google","qq","wechatwork","dingtalk","weibo","github","alipay","apple","baidu","lark","gitlab","twitter","facebook","slack","linkedin","yidun","qingcloud","gitee","instagram","welink","huawei","honor","xiaomi","oppo","aws","amazon","douyin","kuaishou","line","sdbz"]},"extIdpType":{"type":"string","description":"认证类型","enum":["social","enterprise"]},"bindUrl":{"type":"string","description":"认证地址"},"name":{"type":"string","description":"身份源显示名称"},"name_en":{"type":"string","description":"身份源显示名称(英文)"},"desc":{"type":"string","description":"描述"},"desc_en":{"type":"string","description":"描述英文"},"logo":{"type":"string","description":"图标"}},"required":["identifier","extIdpId","type","extIdpType","bindUrl","name"]},"GetExtIdpsRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"外部身份源列表","type":"array","items":{"$ref":"#/components/schemas/ExtIdpInfoDto"}}},"required":["statusCode","message","data"]},"SignInByPasswordPayloadDto":{"type":"object","properties":{"password":{"type":"string","description":"用户密码,默认不加密。Authing 所有 API 均通过 HTTPS 协议对密码进行安全传输,可以在一定程度上保证安全性。\n如果你还需要更高级别的安全性,我们还支持 `RSA256` 和国密 `SM2` 的密码加密方式。详情见可选参数 `options.passwordEncryptType`。\n","example":"passw0rd"},"account":{"type":"string","description":"用户账号(用户名/手机号/邮箱)","example":"test"},"email":{"type":"string","description":"邮箱,不区分大小写。","example":"test@example.com"},"username":{"type":"string","description":"用户名(username)","example":"test"},"phone":{"type":"string","description":"手机号","example":"188xxxx8888"}},"required":["password"]},"SignInByPassCodePayloadDto":{"type":"object","properties":{"passCode":{"type":"string","description":"一次性临时验证码,你需要先调用发送短信或者发送邮件接口获取验证码。","example":"123456"},"email":{"type":"string","description":"邮箱,不区分大小写。","example":"114114"},"phone":{"type":"string","description":"手机号","example":"188xxxx8888"},"phoneCountryCode":{"type":"string","description":"手机区号,中国大陆手机号可不填。Authing 短信服务暂不内置支持国际手机号,你需要在 Authing 控制台配置对应的国际短信服务。完整的手机区号列表可参阅 https://en.wikipedia.org/wiki/List_of_country_calling_codes。","example":"+86","default":"+86"}},"required":["passCode"]},"SignInByAdPayloadDto":{"type":"object","properties":{"password":{"type":"string","description":"用户密码,默认不加密。Authing 所有 API 均通过 HTTPS 协议对密码进行安全传输,可以在一定程度上保证安全性。\n如果你还需要更高级别的安全性,我们还支持 `RSA256` 和国密 `SM2` 的密码加密方式。详情见可选参数 `options.passwordEncryptType`。\n","example":"passw0rd"},"sAMAccountName":{"type":"string","description":"Windows AD 用户目录中账号的 sAMAccountName","example":"test"}},"required":["password","sAMAccountName"]},"SignInByLdapPayloadDto":{"type":"object","properties":{"password":{"type":"string","description":"用户密码,默认不加密。Authing 所有 API 均通过 HTTPS 协议对密码进行安全传输,可以在一定程度上保证安全性。\n如果你还需要更高级别的安全性,我们还支持 `RSA256` 和国密 `SM2` 的密码加密方式。详情见可选参数 `options.passwordEncryptType`。\n","example":"passw0rd"},"sAMAccountName":{"type":"string","description":"LDAP AD 用户目录中账号的 sAMAccountName","example":"114114"}},"required":["password","sAMAccountName"]},"SignInOptionsDto":{"type":"object","properties":{"scope":{"type":"string","description":"需要请求的权限,必须包含 openid。如果需要获取手机号和 email 需要包含 phone email;如果需要 refresh_token 需要包含 offline_access。多个 scope 请用空格分隔。id_token 解码后的内容中会包含这些 scope 对应的用户信息相关的字段。\n- `openid`: 必须包含。\n- `profile`: 返回 birthdate,family_name,gender,given_name,locale,middle_name,name,nickname,picture,preferred_username,profile,updated_at,website,zoneinfo 字段。\n- `username`: 返回 username。\n- `email`: 返回 email,email_verified。\n- `phone`: 返回 phone_number, phone_number_verified。\n- `offline_access`: 如果存在此参数,token 接口会返回 refresh_token 字段。\n- `roles`: 返回用户的角色列表。\n- `external_id`: 用户在原有系统的用户 ID。\n- `extended_fields`: 返回用户的扩展字段信息,内容为一个对象,key 为扩展字段名,value 为扩展字段值。\n- `tenant_id`: 返回用户的租户 ID。\n ","example":"openid profile"},"clientIp":{"type":"string","description":"客户端真实 IP 地址。默认情况下,Authing 会将请求来源的 IP 识别为用户登录的 IP 地址,如果你在后端服务器中调用此接口,需要将此 IP 设置为用户的真实请求 IP。","example":"192.168.0.1"},"context":{"type":"object","description":"额外请求上下文,将会传递到认证前和认证后的 [Pipeline](https://docs.authing.cn/v2/guides/pipeline/) 的 `context` 对象中。了解[如何在 Pipeline 的 `context` 参数中获取传入的额外 context](https://docs.authing.cn/v2/guides/pipeline/context-object.html)。","example":{"source":"utm"}},"tenantId":{"type":"string","description":"租户 ID","example":"625783d629f2bd1f5ddddd98c"},"customData":{"type":"object","description":"设置额外的用户自定义数据,你需要先在 Authing 控制台[配置自定义数据](https://docs.authing.cn/v2/guides/users/user-defined-field/)。","example":{"school":"pku","age":"20"}},"autoRegister":{"type":"boolean","description":"是否开启自动注册。如果设置为 true,当用户不存在的时候,会先自动为其创建一个账号。","example":false},"captchaCode":{"type":"string","description":"Captcha 图形验证码,不区分大小写。当**安全策略**设置为**验证码**且触发**登录失败次数限制**时,下次登录需要填写图形验证码。","example":"a8nz"},"passwordEncryptType":{"type":"string","description":"密码加密类型,支持使用 RSA256 和国密 SM2 算法进行加密。默认为 `none` 不加密。\n- `none`: 不对密码进行加密,使用明文进行传输。\n- `rsa`: 使用 RSA256 算法对密码进行加密,需要使用 Authing 服务的 RSA 公钥进行加密,请阅读**介绍**部分了解如何获取 Authing 服务的 RSA256 公钥。\n- `sm2`: 使用 [国密 SM2 算法](https://baike.baidu.com/item/SM2/15081831) 对密码进行加密,需要使用 Authing 服务的 SM2 公钥进行加密,请阅读**介绍**部分了解如何获取 Authing 服务的 SM2 公钥。\n ","enum":["sm2","rsa","none"],"example":"none","default":"none"}}},"SigninByCredentialsDto":{"type":"object","properties":{"connection":{"type":"string","description":"认证方式:\n- `PASSWORD`: 使用密码方式进行认证。\n- `PASSCODE`: 使用一次性临时验证码进行认证。\n- `LDAP`: 基于 LDAP 用户目录进行认证。\n- `AD`: 基于 Windows AD 用户目录进行认证。\n ","enum":["PASSWORD","PASSCODE","LDAP","AD"],"example":"PASSWORD"},"passwordPayload":{"description":"当认证方式为 `PASSWORD` 时此参数必填。","example":{"email":"test@example.com","password":"passw0rd"},"allOf":[{"$ref":"#/components/schemas/SignInByPasswordPayloadDto"}]},"passCodePayload":{"description":"当认证方式为 `PASSCODE` 时此参数必填","example":{"email":"test@example.com","passCode":"passw0rd"},"allOf":[{"$ref":"#/components/schemas/SignInByPassCodePayloadDto"}]},"adPayload":{"description":"当认证方式为 `AD` 时此参数必填","example":{"sAMAccountName":"test","password":"passw0rd"},"allOf":[{"$ref":"#/components/schemas/SignInByAdPayloadDto"}]},"ldapPayload":{"description":"当认证方式为 `LDAP` 时此参数必填","example":{"sAMAccountName":"test","password":"passw0rd"},"allOf":[{"$ref":"#/components/schemas/SignInByLdapPayloadDto"}]},"options":{"description":"可选参数","example":{"passwordEncryptType":"none"},"allOf":[{"$ref":"#/components/schemas/SignInOptionsDto"}]},"client_id":{"type":"string","description":"应用 ID。当应用的「换取 token 身份验证方式」配置为 `client_secret_post` 需要传。","example":"6342b8537axxxx047d314109"},"client_secret":{"type":"string","description":"应用密钥。当应用的「换取 token 身份验证方式」配置为 `client_secret_post` 需要传。","example":"4203d30e5e915xxxxxx26c31c9adce68"}},"required":["connection"]},"LoginTokenRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/LoginTokenResponseDataDto"}]}},"required":["statusCode","message","data"]},"SignInByWechatPayloadDto":{"type":"object","properties":{"code":{"type":"string","description":"微信移动端社会化登录返回的一次性临时 code","example":"1660291866076"}}},"SignInByApplePayloadDto":{"type":"object","properties":{"code":{"type":"string","description":"苹果移动端社会化登录返回的一次性临时 code","example":"1660291866076"}}},"SignInByAlipayPayloadDto":{"type":"object","properties":{"code":{"type":"string","description":"支付宝移动端社会化登录返回的一次性临时 code","example":"1660291866076"}}},"SignInByWechatworkDto":{"type":"object","properties":{"code":{"type":"string","description":"企业微信移动端社会化登录返回的一次性临时 code","example":"1660291866076"}}},"SignInByWechatworkAgencyPayloadDto":{"type":"object","properties":{"code":{"type":"string","description":"企业微信(代开发模式)移动端社会化登录返回的一次性临时 code","example":"1660291866076"}}},"SignInByLarkPublicPayloadDto":{"type":"object","properties":{"code":{"type":"string","description":"飞书应用商店应用移动端社会化登录返回的一次性临时 code","example":"1660291866076"}}},"SignInByLarkInternalPayloadDto":{"type":"object","properties":{"code":{"type":"string","description":"飞书自建应用移动端社会化登录返回的一次性临时 code","example":"1660291866076"}}},"SignInByLarkBlockPayloadDto":{"type":"object","properties":{"code":{"type":"string","description":"飞书小组件社会化登录返回的一次性临时 code","example":"1660291866076"}}},"SignInByYidunPayloadDto":{"type":"object","properties":{"token":{"type":"string","description":"网易易盾 token","example":"1660291866076"},"accessToken":{"type":"string","description":"网易易盾运营商授权码","example":"1660291866076"}}},"SignInByWechatMiniProgramCodePayloadDto":{"type":"object","properties":{"encryptedData":{"type":"string","description":"获取微信开放数据返回的加密数据(encryptedData)","example":""},"iv":{"type":"string","description":"对称解密算法初始向量,由微信返回","example":""},"code":{"type":"string","description":"`wx.login` 接口返回的用户 `code`","example":""}},"required":["code"]},"SignInByWechatMiniProgramPhonePayloadDto":{"type":"object","properties":{"encryptedData":{"type":"string","description":"获取微信开放数据返回的加密数据(encryptedData)","example":""},"iv":{"type":"string","description":"对称解密算法初始向量,由微信返回","example":""},"code":{"type":"string","description":"`wx.login` 接口返回的用户 `code`","example":""}},"required":["encryptedData","iv","code"]},"SignInByWechatMiniProgramPhoneInfoPayloadDto":{"type":"object","properties":{"code":{"type":"string","description":"小程序获取用户手机号返回的 `code`","example":""}},"required":["code"]},"SignInByWechatMiniProgramCodeAndPhonePayloadDto":{"type":"object","properties":{"wxLoginInfo":{"description":"微信小程序使用 code 登录相关数据,必填","allOf":[{"$ref":"#/components/schemas/SignInByWechatMiniProgramCodePayloadDto"}]},"wxPhoneInfo":{"description":"必填,微信小程序用户授权使用手机号登录相关数据。如果是新用户注册到用户池,手机号将会同步更新到用户信息;如果用户池用户已存在,若用户没有绑定过手机号且从小程序授权的手机号未被绑定过,将会把手机号更新到用户信息上。","allOf":[{"$ref":"#/components/schemas/SignInByWechatMiniProgramPhoneInfoPayloadDto"}]}},"required":["wxLoginInfo","wxPhoneInfo"]},"SignInByGooglePayloadDto":{"type":"object","properties":{"code":{"type":"string","description":"Google 移动端社会化登录获取到的 code","example":""}},"required":["code"]},"SignInByFacebookPayloadDto":{"type":"object","properties":{"access_token":{"type":"string","description":"Facebook 移动端社会化登录获取到的 access_token","example":""}},"required":["access_token"]},"SignInByQQPayloadDto":{"type":"object","properties":{"access_token":{"type":"string","description":"QQ 移动端社会化登录获取到的 access_token","example":""}},"required":["access_token"]},"SignInByWeiboPayloadDto":{"type":"object","properties":{"access_token":{"type":"string","description":"新浪微博移动端社会化登录获取到的 access_token","example":""}},"required":["access_token"]},"SignInByBaiduPayloadDto":{"type":"object","properties":{"code":{"type":"string","description":"百度移动端社会化登录获取到的授权码 `code`。和属性 `access_token` 任选一个参数。两个都不为空,则优先使用授权码 `code` 参数。","example":""},"access_token":{"type":"string","description":"百度移动端社会化登录获取到的授权访问凭证 `access_token`。和属性 `code` 任选一个参数。两个都不为空,则优先使用授权码 `code` 参数。","example":""}}},"SignInByLinkedInPayloadDto":{"type":"object","properties":{"code":{"type":"string","description":"LinkedIn 移动端社会化登录获取到的 code","example":""}},"required":["code"]},"SignInByDingTalkPayloadDto":{"type":"object","properties":{"code":{"type":"string","description":"钉钉移动端社会化登录获取到的 code","example":""},"isSnsCode":{"type":"boolean","description":"如果钉钉移动端社会化登录获取到的 `code` 需要调用 `sns/getuserinfo_bycode` 接口获取授权用户的个人信息,则参数 `isSnsCode` 传 `true`, 否则将通过 `code` 换取 `accessToken` 再获取用户信息","example":""}},"required":["code"]},"SignInByGithubPayloadDto":{"type":"object","properties":{"code":{"type":"string","description":"Github 移动端社会化登录获取到的授权码 `code`","example":""}},"required":["code"]},"SignInByGiteePayloadDto":{"type":"object","properties":{"code":{"type":"string","description":"Gitee 移动端社会化登录获取到的授权码 `code`","example":""}},"required":["code"]},"SignInByGitlabPayloadDto":{"type":"object","properties":{"code":{"type":"string","description":"GitLab 移动端社会化登录获取到的授权码 `code`","example":""}},"required":["code"]},"SignInByDouyinPayloadDto":{"type":"object","properties":{"code":{"type":"string","description":"抖音移动端社会化登录获取到的授权码 `code`","example":""}},"required":["code"]},"SignInByKuaishouPayloadDto":{"type":"object","properties":{"code":{"type":"string","description":"快手移动端社会化登录获取到的授权码 `code`","example":""}},"required":["code"]},"SignInByXiaomiPayloadDto":{"type":"object","properties":{"code":{"type":"string","description":"小米移动端社会化登录获取到的授权码 `code`","example":""}},"required":["code"]},"SignInByLinePayloadDto":{"type":"object","properties":{"access_token":{"type":"string","description":"LINE 移动端社会化登录获取到的 `access_token`","example":""},"id_token":{"type":"string","description":"LINE 移动端社会化登录获取到的 `id_token`, 需要有 `openid` 的权限,将根据`id_token`获取用户信息,否则根据 `access_token` 获取用户信息","example":""}},"required":["access_token"]},"SignInBySlackPayloadDto":{"type":"object","properties":{"code":{"type":"string","description":"Slack 移动端社会化登录获取到的授权码 `code`","example":""}},"required":["code"]},"SignInByOPPOPayloadDto":{"type":"object","properties":{"code":{"type":"string","description":"OPPO 移动端社会化登录获取到的授权码 `code`","example":""}},"required":["code"]},"SignInByHuaweiPayloadDto":{"type":"object","properties":{"code":{"type":"string","description":"华为移动端社会化登录获取到的授权码 `code`","example":""}},"required":["code"]},"SignInByAmazonPayloadDto":{"type":"object","properties":{"access_token":{"type":"string","description":"亚马逊移动端社会化登录获取到的访问令牌 `access_token`","example":""}},"required":["access_token"]},"SignInByMobileOptionsDto":{"type":"object","properties":{"scope":{"type":"string","description":"需要请求的权限,必须包含 openid。如果需要获取手机号和 email 需要包含 phone email;如果需要 refresh_token 需要包含 offline_access。多个 scope 请用空格分隔。id_token 解码后的内容中会包含这些 scope 对应的用户信息相关的字段。\n- `openid`: 必须包含。\n- `profile`: 返回 birthdate,family_name,gender,given_name,locale,middle_name,name,nickname,picture,preferred_username,profile,updated_at,website,zoneinfo 字段。\n- `username`: 返回 username。\n- `email`: 返回 email,email_verified。\n- `phone`: 返回 phone_number, phone_number_verified。\n- `offline_access`: 如果存在此参数,token 接口会返回 refresh_token 字段。\n- `roles`: 返回用户的角色列表。\n- `external_id`: 用户在原有系统的用户 ID。\n- `extended_fields`: 返回用户的扩展字段信息,内容为一个对象,key 为扩展字段名,value 为扩展字段值。\n- `tenant_id`: 返回用户的租户 ID。\n ","example":"openid profile"},"context":{"type":"object","description":"额外请求上下文,将会传递到认证前和认证后的 [Pipeline](https://docs.authing.cn/v2/guides/pipeline/) 的 `context` 对象中。了解[如何在 Pipeline 的 `context` 参数中获取传入的额外 context](https://docs.authing.cn/v2/guides/pipeline/context-object.html)。","example":{"source":"utm"}},"tenantId":{"type":"string","description":"租户 ID","example":"625783d629f2bd1f5ddddd98c"},"customData":{"type":"object","description":"设置额外的用户自定义数据,你需要先在 Authing 控制台[配置自定义数据](https://docs.authing.cn/v2/guides/users/user-defined-field/)。","example":{"school":"pku","age":"20"}}}},"SigninByMobileDto":{"type":"object","properties":{"connection":{"type":"string","description":"移动端社会化登录类型:\n- `apple`: Apple 移动端应用\n- `wechat`: 微信移动应用\n- `alipay`: 支付宝移动应用\n- `wechatwork`: 企业微信移动应用\n- `wechatwork_agency`: 企业微信移动应用(代开发模式)\n- `lark_internal`: 飞书移动端企业自建应用\n- `lark_public`: 飞书移动端应用商店应用\n- `lark_block`: 飞书小组件\n- `yidun`: 网易易盾一键登录\n- `wechat_mini_program_code`: 微信小程序使用 code 登录\n- `wechat_mini_program_phone `: 微信小程序使用手机号登录\n- `wechat_mini_program_code_and_phone `: 微信小程序使用 code 和手机号登录\n- `google`: Google 移动端社会化登录\n- `facebook`: Facebook 移动端社会化登录\n- `qq`: QQ 移动端社会化登录\n- `weibo`: 新浪微博移动端社会化登录\n- `baidu`: 百度移动端社会化登录\n- `linkedin`: LinkedIn 移动端社会化登录\n- `dingtalk`: 钉钉移动端社会化登录\n- `github`: Github 动端社会化登录\n- `gitee`: Gitee 移动端社会化登录\n- `gitlab`: GitLab 移动端社会化登录\n- `douyin`: 抖音移动端社会化登录\n- `kuaishou`: 快手移动端社会化登录\n- `xiaomi`: 小米移动端社会化登录\n- `line`: LINE 移动端社会化登录\n- `slack`: Slack 移动端社会化登录\n- `oppo`: OPPO 移动端社会化登录\n- `huawei`: 华为移动端社会化登录\n- `amazon`: 亚马逊移动端社会化登录\n","enum":["apple","wechat","alipay","wechatwork","wechatwork_agency","lark_internal","lark_public","lark_block","yidun","wechat_mini_program_code","wechat_mini_program_phone","wechat_mini_program_code_and_phone","google","facebook","qq","weibo","baidu","linkedin","dingtalk","github","gitee","gitlab","douyin","kuaishou","xiaomi","line","slack","oppo","huawei","amazon"],"example":"wechat"},"extIdpConnidentifier":{"type":"string","description":"外部身份源连接标志符","example":"wework"},"wechatPayload":{"description":"苹果移动端社会化登录数据,当 `connection` 为 `wechat` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByWechatPayloadDto"}]},"applePayload":{"description":"微信移动端社会化登录数据,当 `connection` 为 `apple` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByApplePayloadDto"}]},"alipayPayload":{"description":"支付宝移动端社会化登录数据,当 `connection` 为 `alipay` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByAlipayPayloadDto"}]},"wechatworkPayload":{"description":"企业微信移动端社会化登录数据,当 `connection` 为 `wechatwork` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByWechatworkDto"}]},"wechatworkAgencyPayload":{"description":"企业微信(代开发模式)移动端社会化登录数据,当 `connection` 为 `wechatwork_agency` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByWechatworkAgencyPayloadDto"}]},"larkPublicPayload":{"description":"飞书应用商店应用移动端社会化登录数据,当 `connection` 为 `lark_public` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByLarkPublicPayloadDto"}]},"larkInternalPayload":{"description":"飞书自建应用移动端社会化登录数据,当 `connection` 为 `lark_internal` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByLarkInternalPayloadDto"}]},"larkBlockPayload":{"description":"飞书小组件移动端社会化登录数据,当 `connection` 为 `lark_block` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByLarkBlockPayloadDto"}]},"yidunPayload":{"description":"网易易盾移动端社会化登录数据,当 `connection` 为 `yidun` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByYidunPayloadDto"}]},"wechatMiniProgramCodePayload":{"description":"微信小程序使用 code 登录相关数据,当 `connection` 为 `wechat_mini_program_code` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByWechatMiniProgramCodePayloadDto"}]},"wechatMiniProgramPhonePayload":{"description":"微信小程序使用手机号登录相关数据,当 `connection` 为 `wechat_mini_program_phone` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByWechatMiniProgramPhonePayloadDto"}]},"wechatMiniProgramCodeAndPhonePayload":{"description":"微信小程序使用 code 和手机号登录相关数据,当 `connection` 为 `wechat_mini_program_code_and_phone` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByWechatMiniProgramCodeAndPhonePayloadDto"}]},"googlePayload":{"description":"Google 移动端社会化登录数据,当 `connection` 为 `google` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByGooglePayloadDto"}]},"facebookPayload":{"description":"Facebook 移动端社会化登录数据,当 `connection` 为 `facebook` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByFacebookPayloadDto"}]},"qqPayload":{"description":"QQ 移动端社会化登录数据,当 `connection` 为 `qq` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByQQPayloadDto"}]},"weiboPayload":{"description":"新浪微博移动端社会化登录数据,当 `connection` 为 `weibo` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByWeiboPayloadDto"}]},"baiduPayload":{"description":"百度移动端社会化登录数据,当 `connection` 为 `baidu` 的时候必填,且 `baiduPayload` 的属性 `code` 和 `access_token` 必选其一,优先使用 `code` 值作为授权登录方式。","allOf":[{"$ref":"#/components/schemas/SignInByBaiduPayloadDto"}]},"linkedInPayload":{"description":"LinkedIn 移动端社会化登录数据,当 `connection` 为 `linkedin` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByLinkedInPayloadDto"}]},"dingTalkPayload":{"description":"钉钉移动端社会化登录数据,当 `connection` 为 `dingtalk` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByDingTalkPayloadDto"}]},"githubPayload":{"description":"Github 移动端社会化登录数据,当 `connection` 为 `github` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByGithubPayloadDto"}]},"giteePayload":{"description":"Gitee 移动端社会化登录数据,当 `connection` 为 `gitee` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByGiteePayloadDto"}]},"gitlabPayload":{"description":"GitLab 移动端社会化登录数据,当 `connection` 为 `gitlab` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByGitlabPayloadDto"}]},"douyinPayload":{"description":"抖音移动端社会化登录数据,当 `connection` 为 `douyin` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByDouyinPayloadDto"}]},"kuaishouPayload":{"description":"快手移动端社会化登录数据,当 `connection` 为 `kuaishou` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByKuaishouPayloadDto"}]},"xiaomiPayload":{"description":"小米移动端社会化登录数据,当 `connection` 为 `xiaomi` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByXiaomiPayloadDto"}]},"linePayload":{"description":"LINE 移动端社会化登录数据,当 `connection` 为 `line` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByLinePayloadDto"}]},"slackPayload":{"description":"Slack 移动端社会化登录数据,当 `connection` 为 `slack` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInBySlackPayloadDto"}]},"oppoPayload":{"description":"OPPO 移动端社会化登录数据,当 `connection` 为 `oppo` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByOPPOPayloadDto"}]},"huaweiPayload":{"description":"华为移动端社会化登录数据,当 `connection` 为 `huawei` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByHuaweiPayloadDto"}]},"amazonPayload":{"description":"亚马逊移动端社会化登录数据,当 `connection` 为 `amazon` 的时候必填。","allOf":[{"$ref":"#/components/schemas/SignInByAmazonPayloadDto"}]},"options":{"description":"可选参数","allOf":[{"$ref":"#/components/schemas/SignInByMobileOptionsDto"}]},"client_id":{"type":"string","description":"应用 ID。当应用的「换取 token 身份验证方式」配置为 `client_secret_post` 需要传。","example":"6342b8537axxxx047d314109"},"client_secret":{"type":"string","description":"应用密钥。当应用的「换取 token 身份验证方式」配置为 `client_secret_post` 需要传。","example":"4203d30e5e915xxxxxx26c31c9adce68"}},"required":["connection","extIdpConnidentifier"]},"SignInBySwitchOptionsDto":{"type":"object","properties":{"scope":{"type":"string","description":"需要请求的权限,必须包含 openid。如果需要获取手机号和 email 需要包含 phone email;如果需要 refresh_token 需要包含 offline_access。多个 scope 请用空格分隔。id_token 解码后的内容中会包含这些 scope 对应的用户信息相关的字段。\n- `openid`: 必须包含。\n- `profile`: 返回 birthdate,family_name,gender,given_name,locale,middle_name,name,nickname,picture,preferred_username,profile,updated_at,website,zoneinfo 字段。\n- `username`: 返回 username。\n- `email`: 返回 email,email_verified。\n- `phone`: 返回 phone_number, phone_number_verified。\n- `offline_access`: 如果存在此参数,token 接口会返回 refresh_token 字段。\n- `roles`: 返回用户的角色列表。\n- `external_id`: 用户在原有系统的用户 ID。\n- `extended_fields`: 返回用户的扩展字段信息,内容为一个对象,key 为扩展字段名,value 为扩展字段值。\n- `tenant_id`: 返回用户的租户 ID。\n ","example":"openid profile"},"context":{"type":"object","description":"额外请求上下文,将会传递到认证前和认证后的 [Pipeline](https://docs.authing.cn/v2/guides/pipeline/) 的 `context` 对象中。了解[如何在 Pipeline 的 `context` 参数中获取传入的额外 context](https://docs.authing.cn/v2/guides/pipeline/context-object.html)。","example":{"source":"utm"}},"customData":{"type":"object","description":"设置额外的用户自定义数据,你需要先在 Authing 控制台[配置自定义数据](https://docs.authing.cn/v2/guides/users/user-defined-field/)。","example":{"school":"pku","age":"20"}}}},"PublicAccountSwitchLoginDto":{"type":"object","properties":{"targetUserId":{"type":"string","description":"切换登录目标用户 ID"},"options":{"description":"可选参数","allOf":[{"$ref":"#/components/schemas/SignInBySwitchOptionsDto"}]}},"required":["targetUserId"]},"AlipayAuthInfoDataDto":{"type":"object","properties":{"authInfo":{"type":"string","description":"拉起支付宝需要的 AuthInfo","example":"apiname=com.alipay.account.auth&app_id=xxxxx&app_name=mc&auth_type=AUTHACCOUNT&biz_type=openservice&method=alipay.open.auth.sdk.code.get&pid=xxxxx&product_id=APP_FAST_LOGIN&scope=kuaijie&sign_type=RSA2&target_id=20141225xxxx&sign=fMcp4GtiM6rxSIeFnJCVePJKV43eXrUP86CQgiLhDHH2u%2FdN75eEvmywc2ulkm7qKRetkU9fbVZtJIqFdMJcJ9Yp%2BJI%2FF%2FpESafFR6rB2fRjiQQLGXvxmDGVMjPSxHxVtIqpZy5FDoKUSjQ2%2FILDKpu3%2F%2BtAtm2jRw1rUoMhgt0%3D"}},"required":["authInfo"]},"GetAlipayAuthInfoRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/AlipayAuthInfoDataDto"}]}},"required":["statusCode","message","data"]},"GenerateQrcodeDto":{"type":"object","properties":{"type":{"type":"string","description":"二维码类型。当前支持三种类型:\n- `MOBILE_APP`: 自建移动端 APP 扫码\n- `WECHAT_MINIPROGRAM`: 微信小程序扫码\n- `WECHAT_OFFICIAL_ACCOUNT` 关注微信公众号扫码","enum":["MOBILE_APP","WECHAT_MINIPROGRAM","WECHAT_OFFICIAL_ACCOUNT"],"example":"MOBILE_APP"},"extIdpConnId":{"type":"string","description":"当 `type` 为 `WECHAT_MINIPROGRAM` 或 `WECHAT_OFFICIAL_ACCOUNT` 时,可以指定身份源连接,否则默认使用应用开启的第一个对应身份源连接生成二维码。","example":"62eb7ed1f04xxxxc6955b329"},"customData":{"type":"object","description":"当 `type` 为 `MOBILE_APP` 时,可以传递用户的自定义数据,当用户成功扫码授权时,会将此数据存入用户的自定义数据。","example":{"school":"hust"}},"context":{"type":"object","description":"当 type 为 `WECHAT_OFFICIAL_ACCOUNT` 或 `WECHAT_MINIPROGRAM` 时,指定自定义的 pipeline 上下文,将会传递的 pipeline 的 context 中","example":{"source":"utm"}},"autoMergeQrCode":{"type":"boolean","description":"当 type 为 `WECHAT_MINIPROGRAM` 时,是否将自定义的 logo 自动合并到生成的图片上,默认为 false。服务器合并二维码的过程会加大接口响应速度,推荐使用默认值,在客户端对图片进行拼接。如果你使用 Authing 的 SDK,可以省去手动拼接的过程。","example":false,"default":false}},"required":["type"]},"GeneQRCodeDataDto":{"type":"object","properties":{"qrcodeId":{"type":"string","description":"二维码唯一 ID,可以通过此唯一 ID 查询二维码状态。","example":"gQE-8TwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAyMGJjX"},"url":{"type":"string","description":"二维码 URL,前端可以基于此链接渲染二维码。","example":"https://files.authing.co/user-contentsqrcode/59f86b4832eb28071bdd9214/gQE-8TwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAyMGJjX1ZhOFNiM1UxV29GVTF5MWMAAgQY4_RiAwSAxhMA.png"},"customLogoUrl":{"type":"string","description":"如果是小程序扫码登录,并且请求参数 autoMergeQrCode 设置为 false,会返回配置的自定义 Logo,前端可以自行将此 Logo 拼接到二维码 URL 上。","example":"https://files.authing.co/authing-console/social-connections/wechatMiniLogin.svg"}},"required":["qrcodeId","url"]},"GeneQRCodeRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/GeneQRCodeDataDto"}]}},"required":["statusCode","message","data"]},"QRCodeStatusBriefUserInfoDto":{"type":"object","properties":{"displayName":{"type":"string","description":"用户显示昵称","example":""},"photo":{"type":"string","description":"用户头像","example":""}},"required":["displayName","photo"]},"CheckQRCodeStatusDataDto":{"type":"object","properties":{"status":{"type":"string","description":"二维码状态。按照用户扫码顺序,共分为 PENDING(未扫码)、SCANNED(已扫码等待用户确认)、AUTHORIZED(用户已授权)、CANCELLED(取消授权)、EXPIRED(二维码过期)以及 ERROR(未知错误)六种状态。","enum":["PENDING","SCANNED","AUTHORIZED","CANCELLED","EXPIRED","ERROR"],"example":"PENDING"},"ticket":{"type":"string","description":"当二维码状态为已授权时返回。如果在控制台应用安全 - 通用安全 - 登录安全 - APP 扫码登录 Web 安全中未开启「Web 轮询接口返回完整用户信息」(默认处于关闭状态),会返回此 ticket,用于换取完整的用户信息。","example":""},"briefUserInfo":{"description":"","example":"当二维码状态为已扫码、已授权、已取消授权时返回。如果在控制台应用安全 - 通用安全 - 登录安全 - APP 扫码登录 Web 安全中未开启「Web 轮询接口返回完整用户信息」(默认处于关闭状态),接口只会返回用户的头像和显示名称,前端可以基于此渲染用户昵称和头像,给到用户已成功扫码的提示。","allOf":[{"$ref":"#/components/schemas/QRCodeStatusBriefUserInfoDto"}]},"tokenSet":{"description":"当二维码状态为已授权并且在控制台应用安全 - 通用安全 - 登录安全 - APP 扫码登录 Web 安全中开启了「Web 轮询接口返回完整用户信息」(默认处于关闭状态)开关,此数据才会返回。推荐使用 ticket 换取用户信息。","allOf":[{"$ref":"#/components/schemas/LoginTokenResponseDataDto"}]}},"required":["status"]},"CheckQRCodeStatusRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/CheckQRCodeStatusDataDto"}]}},"required":["statusCode","message","data"]},"ExchangeTokenSetWithQRcodeTicketDto":{"type":"object","properties":{"ticket":{"type":"string","description":"当二维码状态为已授权时返回。如果在控制台应用安全 - 通用安全 - 登录安全 - APP 扫码登录 Web 安全中未开启「Web 轮询接口返回完整用户信息」(默认处于关闭状态),会返回此 ticket,用于换取完整的用户信息。","example":""},"client_id":{"type":"string","description":"应用 ID。当应用的「换取 token 身份验证方式」配置为 `client_secret_post` 需要传。","example":"6342b8537axxxx047d314109"},"client_secret":{"type":"string","description":"应用密钥。当应用的「换取 token 身份验证方式」配置为 `client_secret_post` 需要传。","example":"4203d30e5e915xxxxxx26c31c9adce68"}},"required":["ticket"]},"ChangeQRCodeStatusDto":{"type":"object","properties":{"qrcodeId":{"type":"string","description":"二维码唯一 ID","example":""},"action":{"type":"string","description":"修改二维码状态的动作:\n- `SCAN`: 修改二维码状态为已扫码状态,当移动 APP 扫了码之后,应当立即执行此操作;\n- `CONFIRM`: 修改二维码状态为已授权,执行此操作前必须先执行 `SCAN 操作;\n- `CANCEL`: 修改二维码状态为已取消,执行此操作前必须先执行 `SCAN 操作;\n ","enum":["SCAN","CONFIRM","CANCEL"],"example":"CONFIRM"}},"required":["qrcodeId","action"]},"AppQRCodeLoginDto":{"type":"object","properties":{"qrcodeId":{"type":"string","description":"二维码唯一 ID","example":""},"action":{"type":"string","description":"APP 扫二维码登录:\n- `APP_LOGIN`: APP 扫码登录;\n ","enum":["APP_LOGIN"],"example":"APP_LOGIN"}},"required":["qrcodeId","action"]},"SignInByPushOptionsDto":{"type":"object","properties":{"scope":{"type":"string","description":"需要请求的权限,必须包含 openid。如果需要获取手机号和 email 需要包含 phone email;如果需要 refresh_token 需要包含 offline_access。多个 scope 请用空格分隔。id_token 解码后的内容中会包含这些 scope 对应的用户信息相关的字段。\n- `openid`: 必须包含。\n- `profile`: 返回 birthdate,family_name,gender,given_name,locale,middle_name,name,nickname,picture,preferred_username,profile,updated_at,website,zoneinfo 字段。\n- `username`: 返回 username。\n- `email`: 返回 email,email_verified。\n- `phone`: 返回 phone_number, phone_number_verified。\n- `offline_access`: 如果存在此参数,token 接口会返回 refresh_token 字段。\n- `roles`: 返回用户的角色列表。\n- `external_id`: 用户在原有系统的用户 ID。\n- `extended_fields`: 返回用户的扩展字段信息,内容为一个对象,key 为扩展字段名,value 为扩展字段值。\n- `tenant_id`: 返回用户的租户 ID。\n ","example":"openid profile"},"context":{"type":"string","description":"额外请求上下文,将会传递到认证前和认证后的 [Pipeline](https://docs.authing.cn/v2/guides/pipeline/) 的 `context` 对象中。了解[如何在 Pipeline 的 `context` 参数中获取传入的额外 context](https://docs.authing.cn/v2/guides/pipeline/context-object.html)。","example":{"source":"utm"}},"customData":{"type":"object","description":"设置额外的用户自定义数据,你需要先在 Authing 控制台[配置自定义数据](https://docs.authing.cn/v2/guides/users/user-defined-field/)。","example":{"school":"pku","age":"20"}}}},"SignInByPushDto":{"type":"object","properties":{"account":{"type":"string","description":"用户账号(用户名/手机号/邮箱)","example":"test"},"options":{"description":"可选参数","allOf":[{"$ref":"#/components/schemas/SignInByPushOptionsDto"}]}},"required":["account"]},"GenePushCodeDataDto":{"type":"object","properties":{"pushCodeId":{"type":"string","description":"推送码(推送登录唯一 ID),可以通过此唯一 ID 查询推送码状态。","example":"gQE-8TwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAyMGJjX"},"expireTime":{"type":"number","description":"推送码 `${expireTime}` 秒后过期,如 120 秒后过期。","example":120}},"required":["pushCodeId","expireTime"]},"GenePushCodeRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/GenePushCodeDataDto"}]}},"required":["statusCode","message","data"]},"CheckPushCodeStatusDataDto":{"type":"object","properties":{"status":{"type":"string","description":"推送码状态。按照推送登录顺序,共分为 PUSHED(已推送)、AUTHORIZED(用户已授权)、CANCELLED(取消授权)、EXPIRED(推送登录过期)以及 ERROR(未知错误)五种状态。","enum":["PUSHED","AUTHORIZED","CANCELLED","EXPIRED","ERROR"],"example":"PUSHED"},"tokenSet":{"description":"当推送码状态为已授权,此数据才会返回。","allOf":[{"$ref":"#/components/schemas/LoginTokenResponseDataDto"}]}},"required":["status"]},"CheckPushCodeStatusRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/CheckPushCodeStatusDataDto"}]}},"required":["statusCode","message","data"]},"ChangePushCodeStatusDto":{"type":"object","properties":{"pushCodeId":{"type":"string","description":"推送码(推送登录唯一 ID)","example":""},"action":{"type":"string","description":"修改推送码状态的动作:\n- `CONFIRM`: 修改推送码状态为已授权;\n- `CANCEL`: 修改推送码状态为已取消;\n ","enum":["CONFIRM","CANCEL"],"example":"CONFIRM"}},"required":["pushCodeId","action"]},"GetPushCodeRelationAppsDto":{"type":"object","properties":{"pushCodeId":{"type":"string","description":"推送码(推送登录唯一 ID)","example":""},"appId":{"type":"string","description":"发起推送登录的应用 ID","example":""}},"required":["pushCodeId","appId"]},"GetPushCodeRelationAppsDataDto":{"type":"object","properties":{"appIds":{"description":"发起推送登录的应用关联的客户端应用数据","example":["xxxxxxxxxx"],"type":"array","items":{"type":"string"}}}},"GetPushCodeRelationAppsRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/GetPushCodeRelationAppsDataDto"}]}},"required":["statusCode","message","data"]},"SignInFastpassOptionsDto":{"type":"object","properties":{"scope":{"type":"string","description":"需要请求的权限,必须包含 openid。如果需要获取手机号和 email 需要包含 phone email;如果需要 refresh_token 需要包含 offline_access。多个 scope 请用空格分隔。id_token 解码后的内容中会包含这些 scope 对应的用户信息相关的字段。\n- `openid`: 必须包含。\n- `profile`: 返回 birthdate,family_name,gender,given_name,locale,middle_name,name,nickname,picture,preferred_username,profile,updated_at,website,zoneinfo 字段。\n- `username`: 返回 username。\n- `email`: 返回 email,email_verified。\n- `phone`: 返回 phone_number, phone_number_verified。\n- `offline_access`: 如果存在此参数,token 接口会返回 refresh_token 字段。\n- `roles`: 返回用户的角色列表。\n- `external_id`: 用户在原有系统的用户 ID。\n- `extended_fields`: 返回用户的扩展字段信息,内容为一个对象,key 为扩展字段名,value 为扩展字段值。\n- `tenant_id`: 返回用户的租户 ID。\n ","example":"openid profile"},"context":{"type":"object","description":"额外请求上下文,将会传递到认证前和认证后的 [Pipeline](https://docs.authing.cn/v2/guides/pipeline/) 的 `context` 对象中。了解[如何在 Pipeline 的 `context` 参数中获取传入的额外 context](https://docs.authing.cn/v2/guides/pipeline/context-object.html)。","example":{"source":"utm"}},"customData":{"type":"object","description":"设置额外的用户自定义数据,你需要先在 Authing 控制台[配置自定义数据](https://docs.authing.cn/v2/guides/users/user-defined-field/)。","example":{"school":"pku","age":"20"}}}},"SignInFastpassDto":{"type":"object","properties":{"options":{"description":"可选参数","allOf":[{"$ref":"#/components/schemas/SignInFastpassOptionsDto"}]}}},"FastpassUserInfoDto":{"type":"object","properties":{"id":{"type":"string","description":"用户 ID"},"displayName":{"type":"string","description":"用户名称"},"photo":{"type":"string","description":"用户头像地址"}},"required":["id","displayName","photo"]},"GeneFastpassQRCodeInfoDto":{"type":"object","properties":{"scene":{"type":"string","description":"二维码使用场景。"},"qrcodeId":{"type":"string","description":"二维码唯一 ID,可以通过此唯一 ID 查询二维码状态。","example":"gQE-8TwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAyMGJjX"},"apiHost":{"type":"string","description":"服务接口 Host 地址","example":"https://example.authing.cn"},"user":{"description":"用户信息","allOf":[{"$ref":"#/components/schemas/FastpassUserInfoDto"}]},"appId":{"type":"string","description":"当前用户生成二维码时登录的应用 ID"},"userpool":{"description":"用户池信息","allOf":[{"$ref":"#/components/schemas/FastpassUserInfoDto"}]}},"required":["scene","qrcodeId","apiHost","user","appId","userpool"]},"GeneFastpassQRCodeRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/GeneFastpassQRCodeInfoDto"}]}},"required":["statusCode","message"]},"FastpassQRCodeRelationAppDto":{"type":"object","properties":{"id":{"type":"string","description":"应用 ID"},"name":{"type":"string","description":"应用名称"},"logo":{"type":"string","description":"应用 logo"}},"required":["id","name"]},"GetFastpassQRCodeRelationAppsDto":{"type":"object","properties":{"relationApps":{"description":"关联的客户端应用信息","type":"array","items":{"$ref":"#/components/schemas/FastpassQRCodeRelationAppDto"}}}},"GetFastpassQRCodeRelationAppsRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/GetFastpassQRCodeRelationAppsDto"}]}},"required":["statusCode","message","data"]},"SendSMSDto":{"type":"object","properties":{"phoneNumber":{"type":"string","description":"手机号,不带区号。如果是国外手机号,请在 phoneCountryCode 参数中指定区号。","example":"188xxxx8888"},"channel":{"type":"string","description":"短信通道,指定发送此短信的目的:\n- `CHANNEL_LOGIN`: 用于用户登录\n- `CHANNEL_REGISTER`: 用于用户注册\n- `CHANNEL_RESET_PASSWORD`: 用于重置密码\n- `CHANNEL_BIND_PHONE`: 用于绑定手机号\n- `CHANNEL_UNBIND_PHONE`: 用于解绑手机号\n- `CHANNEL_BIND_MFA`: 用于绑定 MFA\n- `CHANNEL_VERIFY_MFA`: 用于验证 MFA\n- `CHANNEL_UNBIND_MFA`: 用于解绑 MFA\n- `CHANNEL_COMPLETE_PHONE`: 用于在注册/登录时补全手机号信息 \n- `CHANNEL_IDENTITY_VERIFICATION`: 用于进行用户实名认证\n- `CHANNEL_DELETE_ACCOUNT`: 用于注销账号\n ","enum":["CHANNEL_LOGIN","CHANNEL_REGISTER","CHANNEL_RESET_PASSWORD","CHANNEL_BIND_PHONE","CHANNEL_UNBIND_PHONE","CHANNEL_BIND_MFA","CHANNEL_VERIFY_MFA","CHANNEL_UNBIND_MFA","CHANNEL_COMPLETE_PHONE","CHANNEL_IDENTITY_VERIFICATION","CHANNEL_DELETE_ACCOUNT"],"example":"CHANNEL_LOGIN"},"phoneCountryCode":{"type":"string","description":"手机区号,中国大陆手机号可不填。Authing 短信服务暂不内置支持国际手机号,你需要在 Authing 控制台配置对应的国际短信服务。完整的手机区号列表可参阅 https://en.wikipedia.org/wiki/List_of_country_calling_codes。","example":"+86"}},"required":["phoneNumber","channel"]},"SendSMSRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"}},"required":["statusCode","message"]},"SendEmailDto":{"type":"object","properties":{"email":{"type":"string","description":"邮箱,不区分大小写","example":"test@example.com"},"channel":{"type":"string","description":"短信通道,指定发送此短信的目的:\n- `CHANNEL_LOGIN`: 用于用户登录\n- `CHANNEL_REGISTER`: 用于用户注册\n- `CHANNEL_RESET_PASSWORD`: 用于重置密码\n- `CHANNEL_VERIFY_EMAIL_LINK`: 用于验证邮箱地址\n- `CHANNEL_UPDATE_EMAIL`: 用于修改邮箱\n- `CHANNEL_BIND_EMAIL`: 用于绑定邮箱\n- `CHANNEL_UNBIND_EMAIL`: 用于解绑邮箱\n- `CHANNEL_VERIFY_MFA`: 用于验证 MFA\n- `CHANNEL_UNLOCK_ACCOUNT`: 用于自助解锁\n- `CHANNEL_COMPLETE_EMAIL`: 用于注册/登录时补全邮箱信息 \n- `CHANNEL_DELETE_ACCOUNT`: 用于注销账号\n","enum":["CHANNEL_LOGIN","CHANNEL_REGISTER","CHANNEL_RESET_PASSWORD","CHANNEL_VERIFY_EMAIL_LINK","CHANNEL_UPDATE_EMAIL","CHANNEL_BIND_EMAIL","CHANNEL_UNBIND_EMAIL","CHANNEL_VERIFY_MFA","CHANNEL_UNLOCK_ACCOUNT","CHANNEL_COMPLETE_EMAIL","CHANNEL_DELETE_ACCOUNT"],"example":"CHANNEL_LOGIN"}},"required":["email","channel"]},"SendEmailRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"}},"required":["statusCode","message"]},"PreCheckSmsCodeDto":{"type":"object","properties":{"phone":{"type":"string","description":"手机号,不带区号。如果是国外手机号,请在 phoneCountryCode 参数中指定区号。","example":"188xxxx8888"},"passCode":{"type":"string","description":"短信验证码","example":"123456"},"phoneCountryCode":{"type":"string","description":"手机区号,中国大陆手机号可不填。Authing 短信服务暂不内置支持国际手机号,你需要在 Authing 控制台配置对应的国际短信服务。完整的手机区号列表可参阅 https://en.wikipedia.org/wiki/List_of_country_calling_codes。","example":"+86"},"channel":{"type":"string","description":"短信通道,指定发送此短信的目的,如 CHANNEL_LOGIN 用于登录、CHANNEL_REGISTER 用于注册。","enum":["CHANNEL_LOGIN","CHANNEL_REGISTER","CHANNEL_RESET_PASSWORD","CHANNEL_BIND_PHONE","CHANNEL_UNBIND_PHONE","CHANNEL_BIND_MFA","CHANNEL_VERIFY_MFA","CHANNEL_UNBIND_MFA","CHANNEL_COMPLETE_PHONE","CHANNEL_IDENTITY_VERIFICATION","CHANNEL_DELETE_ACCOUNT"],"example":"CHANNEL_LOGIN"}},"required":["phone","passCode","channel"]},"PreCheckEmailCodeDto":{"type":"object","properties":{"email":{"type":"string","description":"邮箱,不区分大小写","example":"test@example.com"},"passCode":{"type":"string","description":"邮箱验证码","example":"123456"},"channel":{"type":"string","description":"短信通道,指定发送此短信的目的,如 CHANNEL_LOGIN 用于登录、CHANNEL_REGISTER 用于注册。","enum":["CHANNEL_LOGIN","CHANNEL_REGISTER","CHANNEL_RESET_PASSWORD","CHANNEL_VERIFY_EMAIL_LINK","CHANNEL_UPDATE_EMAIL","CHANNEL_BIND_EMAIL","CHANNEL_UNBIND_EMAIL","CHANNEL_VERIFY_MFA","CHANNEL_UNLOCK_ACCOUNT","CHANNEL_COMPLETE_EMAIL","CHANNEL_DELETE_ACCOUNT"],"example":"CHANNEL_LOGIN"}},"required":["email","passCode","channel"]},"PreCheckCodeDto":{"type":"object","properties":{"codeType":{"type":"string","description":"验证码类型","enum":["SMS","EMAIL"],"example":"SMS"},"smsCodePayload":{"description":"短信验证码检验参数","allOf":[{"$ref":"#/components/schemas/PreCheckSmsCodeDto"}]},"emailCodePayload":{"description":"邮箱验证码检验参数","allOf":[{"$ref":"#/components/schemas/PreCheckEmailCodeDto"}]}},"required":["codeType"]},"PreCheckCodeDataDto":{"type":"object","properties":{"isValid":{"type":"boolean","description":"验证码是否正确且有效","example":true},"message":{"type":"string","description":"如果验证码不正确或者已失效,具体的错误信息","example":"验证码已过期"}},"required":["isValid"]},"PreCheckCodeRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/PreCheckCodeDataDto"}]}},"required":["statusCode","message","data"]},"DecryptWechatMiniProgramDataDto":{"type":"object","properties":{"extIdpConnidentifier":{"type":"string","description":"微信小程序的外部身份源连接标志符","example":"my-wxapp"},"encryptedData":{"type":"string","description":"获取微信开放数据返回的加密数据(encryptedData)","example":""},"iv":{"type":"string","description":"对称解密算法初始向量,由微信返回","example":""},"code":{"type":"string","description":"`wx.login` 接口返回的用户 `code`","example":""}},"required":["extIdpConnidentifier","encryptedData","iv","code"]},"DecryptWechatMiniProgramDataRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"type":"object","description":"响应数据","example":{"nickName":"张三","gender":1,"language":"zh_CN","city":"Guangzhou","province":"Guangdong","country":"CN","avatarUrl":"http://wx.qlogo.cn/mmopen/vi_32/aSKcBBPpibyKNicHNTMM0qJVh8Kjgiak2AHWr8MHM4WgMEm7GFhsf8OYrySdbvAMvTsw3mo8ibKicsnfN5pRjl1p8HQ/0","unionId":"ocMvos6NjeKLIBqg5Mr9QjxrP1FA","watermark":{"timestamp":1477314187,"appid":"wx4f4bc4dec97d474b"}}}},"required":["statusCode","message","data"]},"GetWechatMiniProgramPhoneDto":{"type":"object","properties":{"extIdpConnidentifier":{"type":"string","description":"微信小程序的外部身份源连接标志符","example":"my-wxapp"},"code":{"type":"string","description":"`open-type=getphonecode` 接口返回的 `code`","example":""}},"required":["extIdpConnidentifier","code"]},"GetWechatMiniProgramPhoneDataDto":{"type":"object","properties":{"phoneNumber":{"type":"string","description":"包含区号的手机号","example":"+86188xxxx8888"},"purePhoneNumber":{"type":"string","description":"不包含区号的手机号","example":"188xxxx8888"},"countryCode":{"type":"string","description":"区号","example":"86"}},"required":["phoneNumber","purePhoneNumber","countryCode"]},"GetWechatMiniProgramPhoneRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/GetWechatMiniProgramPhoneDataDto"}]}},"required":["statusCode","message","data"]},"GetWechatAccessTokenDto":{"type":"object","properties":{"appId":{"type":"string","description":"微信小程序或微信公众号的 AppId","example":""},"appSecret":{"type":"string","description":"微信小程序或微信公众号的 AppSecret","example":""}},"required":["appId","appSecret"]},"GetWechatAccessTokenDataDto":{"type":"object","properties":{"accessToken":{"type":"string","description":"Authing 服务器缓存的微信 Access Token","example":""},"expiresAt":{"type":"string","description":"Access Token 到期时间,为单位为秒的时间戳","example":0}},"required":["accessToken","expiresAt"]},"GetWechatAccessTokenRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/GetWechatAccessTokenDataDto"}]}},"required":["statusCode","message","data"]},"GetWechatAccessTokenInfoRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/GetWechatAccessTokenDataDto"}]}},"required":["statusCode","message","data"]},"ParsedUserAgent":{"type":"object","properties":{"device":{"type":"string","description":"使用的设备类型","example":"Desktop"},"browser":{"type":"string","description":"浏览器名称","example":"Chrome"},"os":{"type":"string","description":"操作系统","example":"Windows"}},"required":["device","browser","os"]},"GeoIpLocation":{"type":"object","properties":{"lon":{"type":"number","description":"经度","example":116.3889},"lat":{"type":"number","description":"纬度","example":39.9288}},"required":["lon","lat"]},"GeoIp":{"type":"object","properties":{"location":{"description":"地理位置","allOf":[{"$ref":"#/components/schemas/GeoIpLocation"}]},"country_name":{"type":"string","description":"Country Name","example":"China"},"country_code2":{"type":"string","description":"Country Code 2","example":"CN"},"country_code3":{"type":"string","description":"Country Code 3","example":"CN"},"region_name":{"type":"string","description":"Region Name","example":"Beijing"},"region_code":{"type":"string","description":"Region Code","example":"BJ"},"city_name":{"type":"string","description":"城市名称","example":"Beijing"},"continent_code":{"type":"string","description":"Continent Code","example":"AS"},"timezone":{"type":"string","description":"时区","example":"Asia/Shanghai"}},"required":["location","country_name","country_code2","country_code3","region_name","region_code","city_name","continent_code","timezone"]},"LoginHistoryDto":{"type":"object","properties":{"userId":{"type":"string","description":"用户 ID","example":"xxx"},"appId":{"type":"string","description":"应用 ID","example":"xxx"},"appName":{"type":"string","description":"应用名称","example":"示例应用"},"appLoginUrl":{"type":"string","description":"应用登录地址","example":"https://example.authing.cn/login"},"appLogo":{"type":"string","description":"应用 Logo","example":"https://files.authing.co/authing-console/default-app-logo.png"},"loginAt":{"type":"string","description":"登录时间","example":"2022-07-03T02:20:30.000Z"},"clientIp":{"type":"string","description":"登录时使用的客户端 IP","example":"127.0.0.1"},"success":{"type":"boolean","description":"是否登录成功","example":true},"errorMessage":{"type":"string","description":"登录失败时的具体错误信息","example":"账号或密码不正确"},"userAgent":{"type":"string","description":"User Agent","example":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36"},"parsedUserAgent":{"description":"解析过后的 User Agent","allOf":[{"$ref":"#/components/schemas/ParsedUserAgent"}]},"loginMethod":{"type":"string","description":"使用的登录方式","example":"loginByEmail"},"geoip":{"description":"地理位置","allOf":[{"$ref":"#/components/schemas/GeoIp"}]},"tenantId":{"type":"string","description":"租户 ID","example":"642c1df417c2d8a80d744c1d"}},"required":["userId","appId","appName","appLoginUrl","appLogo","loginAt","clientIp","success","userAgent","parsedUserAgent","loginMethod","geoip"]},"LoginHistoryPaginatedRespDto":{"type":"object","properties":{"totalCount":{"type":"number","description":"记录总数"},"list":{"description":"记录列表","type":"array","items":{"$ref":"#/components/schemas/LoginHistoryDto"}}},"required":["totalCount","list"]},"GetLoginHistoryRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/LoginHistoryPaginatedRespDto"}]}},"required":["statusCode","message","data"]},"LoggedInAppsDto":{"type":"object","properties":{"appId":{"type":"string","description":"应用 ID","example":"xxx"},"appName":{"type":"string","description":"应用名称","example":"示例应用"},"appLoginUrl":{"type":"string","description":"应用登录地址","example":"https://example.authing.cn/login"},"appLogo":{"type":"string","description":"应用 Logo","example":"https://files.authing.co/authing-console/default-app-logo.png"},"active":{"type":"boolean","description":"当前是否处于登录态","example":true}},"required":["appId","appName","appLoginUrl","appLogo","active"]},"GetLoggedInAppsRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","type":"array","items":{"$ref":"#/components/schemas/LoggedInAppsDto"}}},"required":["statusCode","message","data"]},"AccessibleAppsDto":{"type":"object","properties":{"appId":{"type":"string","description":"应用 ID","example":"xxx"},"appName":{"type":"string","description":"应用名称","example":"示例应用"},"appLoginUrl":{"type":"string","description":"应用登录地址","example":"https://example.authing.cn/login"},"appLogo":{"type":"string","description":"应用 Logo","example":"https://files.authing.co/authing-console/default-app-logo.png"},"active":{"type":"boolean","description":"当前是否处于登录态","example":true}},"required":["appId","appName","appLoginUrl","appLogo","active"]},"GetAccessibleAppsRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","type":"array","items":{"$ref":"#/components/schemas/AccessibleAppsDto"}}},"required":["statusCode","message","data"]},"UserTenantListDto":{"type":"object","properties":{"tenantId":{"type":"string","description":"租户 ID","example":"xxxx"},"tenantName":{"type":"string","description":"租户名称","example":"xxxx"},"joinAt":{"format":"date-time","type":"string","description":"加入租户的时间","example":"xxxx"}},"required":["tenantId","tenantName","joinAt"]},"GetTenantListRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","type":"array","items":{"$ref":"#/components/schemas/UserTenantListDto"}}},"required":["statusCode","message","data"]},"RoleDto":{"type":"object","properties":{"id":{"type":"string","description":"角色 ID","example":"60b49eb83fd80adb96f26e68"},"code":{"type":"string","description":"权限分组(权限空间)内角色的唯一标识符 Code","example":"role1"},"name":{"type":"string","description":"权限分组(权限空间)内角色名称","example":"role1"},"description":{"type":"string","description":"角色描述","example":"this is role description"},"namespace":{"type":"string","description":"所属权限分组(权限空间)的 Code","example":"default"},"namespaceName":{"type":"string","description":"所属权限分组(权限空间)的名称","example":"示例权限名称"},"status":{"type":"string","description":"角色状态,ENABLE-表示正常,DISABLE-表示禁止","example":"ENABLE"},"disableTime":{"type":"number","description":"角色自动禁止时间,单位毫秒, 如果传null表示永久有效","example":"1669881887852"}},"required":["id","code","name","description","namespace","namespaceName"]},"RoleListRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","type":"array","items":{"$ref":"#/components/schemas/RoleDto"}}},"required":["statusCode","message","data"]},"GroupDto":{"type":"object","properties":{"id":{"type":"string","description":"分组 ID","example":"60b49eb83fd80adb96f26e68"},"code":{"type":"string","description":"分组 code","example":"developer"},"name":{"type":"string","description":"分组名称","example":"开发者"},"description":{"type":"string","description":"分组描述","example":"描述内容"},"type":{"type":"string","description":"分组类型","example":"static"},"metadataSource":{"description":"分组元数据信息","type":"array","items":{"type":"string"}},"members":{"description":"成员列表","type":"array","items":{"$ref":"#/components/schemas/UserDto"}}},"required":["id","code","name","description","type","metadataSource","members"]},"GroupListRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","type":"array","items":{"$ref":"#/components/schemas/GroupDto"}}},"required":["statusCode","message","data"]},"LangUnit":{"type":"object","properties":{"enabled":{"type":"boolean","description":"是否已开启。若开启,且控制台选择该语言,则展示该内容。(默认关闭)","example":false},"value":{"type":"string","description":"多语言内容","example":false}},"required":["enabled","value"]},"LangObject":{"type":"object","properties":{"zh-CN":{"description":"多语言的中文内容","example":{"enabled":false,"value":"中文"},"allOf":[{"$ref":"#/components/schemas/LangUnit"}]},"en-US":{"description":"多语言的英文内容","example":{"enabled":false,"value":"English"},"allOf":[{"$ref":"#/components/schemas/LangUnit"}]},"zh-TW":{"description":"多语言的繁体中文内容","example":{"enabled":false,"value":"繁體中文"},"allOf":[{"$ref":"#/components/schemas/LangUnit"}]},"ja-JP":{"description":"多语言的日语内容","example":{"enabled":false,"value":"日本語"},"allOf":[{"$ref":"#/components/schemas/LangUnit"}]}},"required":["zh-CN","en-US","zh-TW","ja-JP"]},"DepartmentI18nDto":{"type":"object","properties":{"name":{"description":"支持多语言的字段","example":{"zh-CN":{"enabled":false,"value":"中文"},"en-US":{"enabled":false,"value":"English"}},"allOf":[{"$ref":"#/components/schemas/LangObject"}]}},"required":["name"]},"UserDepartmentRespDto":{"type":"object","properties":{"organizationCode":{"type":"string","description":"组织 Code(organizationCode)","example":"steamory"},"departmentId":{"type":"string","description":"部门 ID","example":"60b49eb83fd80adb96f26e68"},"isRoot":{"type":"boolean","description":"是否为根部门","example":false},"createdAt":{"format":"date-time","type":"string","description":"部门创建时间","example":"2022-07-03T02:20:30.000Z"},"name":{"type":"string","description":"部门名称","example":"dd8d7stf44"},"description":{"type":"string","description":"部门描述","example":"dd8d7stf44"},"openDepartmentId":{"type":"string","description":"自定义部门 ID,用于存储自定义的 ID","example":"ou_7dab8a3d3cdccxxxxxx777c7ad535d62"},"isLeader":{"type":"boolean","description":"是否是部门 Leader","example":true},"code":{"type":"string","description":"部门识别码","example":"6229c4deb3e4d8a20b6021ff"},"isMainDepartment":{"type":"boolean","description":"是否是主部门","example":true},"joinedAt":{"format":"date-time","type":"string","description":"加入部门时间","example":"2022-07-03T02:20:30.000Z"},"isVirtualNode":{"type":"boolean","description":"是否是虚拟部门","example":false},"i18n":{"description":"多语言设置","example":{"name":{"zh-CN":{"enabled":false,"value":"中文"},"en-US":{"enabled":false,"value":"English"}}},"allOf":[{"$ref":"#/components/schemas/DepartmentI18nDto"}]},"customData":{"type":"object","description":"部门的扩展字段数据","example":{"icon":"https://example.com/logo"}},"departmentIdPath":{"description":"部门 ID 路径","example":["parentId1","parentId2"],"type":"array","items":{"type":"string"}},"departmentCodePath":{"description":"部门 Code 路径","example":["parentCode1","parentCode2"],"type":"array","items":{"type":"string"}},"departmentNamePath":{"description":"部门名路径","example":["parentName1","parentName2"],"type":"array","items":{"type":"string"}}},"required":["organizationCode","departmentId","isRoot","createdAt","name","description","isLeader","code","isMainDepartment","joinedAt","isVirtualNode"]},"UserDepartmentPagingDto":{"type":"object","properties":{"totalCount":{"type":"number","description":"记录总数"},"list":{"description":"响应数据","type":"array","items":{"$ref":"#/components/schemas/UserDepartmentRespDto"}}},"required":["totalCount","list"]},"UserDepartmentPaginatedRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/UserDepartmentPagingDto"}]}},"required":["statusCode","message","data"]},"PolicyCondition":{"type":"object","properties":{"param":{"type":"string","description":"Condition Param","example":"AppId","enum":["UserPoolId","AppId","RequestFrom","UserId","UserArn","CurrentTime","EpochTime","SourceIp","User","MultiFactorAuthPresent","MultiFactorAuthAge","UserAgent","Referer","Device","OS","Country","Province","City","DeviceChanged","DeviceUntrusted","ProxyUntrusted","LoggedInApps","Namespace"]},"operator":{"type":"string","description":"Condition Operator","example":"StringEquals","enum":["Bool","DateEquals","DateNotEquals","DateLessThan","DateLessThanEquals","DateGreaterThan","DateGreaterThanEquals","IpAddress","NotIpAddress","NumericEquals","NumericNotEquals","NumericLessThan","NumericLessThanEquals","NumericGreaterThan","NumericGreaterThanEquals","StringEquals","StringNotEquals","StringEqualsIgnoreCase","StringNotEqualsIgnoreCase","StringLike","StringNotLike","ListContains"]},"value":{"type":"string","description":"Condition Value","example":"1"}},"required":["param","operator","value"]},"AuthorizedResourceDto":{"type":"object","properties":{"resourceCode":{"type":"string","description":"资源描述符","example":"ecs:1"},"description":{"type":"string","description":"资源描述信息","example":"服务器"},"condition":{"description":"策略 Condition","type":"array","items":{"$ref":"#/components/schemas/PolicyCondition"}},"resourceType":{"type":"string","description":"资源类型","example":"API","default":null,"enum":["DATA","API","MENU","BUTTON","UI"]},"apiIdentifier":{"type":"string","description":"API URL","example":"/api/v1/example","default":null},"actions":{"description":"授权的操作列表","example":["ecs:Start","ecs:Stop"],"type":"array","items":{"type":"string"}},"effect":{"type":"string","description":"允许还是拒绝","example":"ALLOW","default":"ALLOW","enum":["ALLOW","DENY"]}},"required":["resourceCode","resourceType","apiIdentifier","actions","effect"]},"AuthorizedResourcePagingDto":{"type":"object","properties":{"totalCount":{"type":"number","description":"记录总数"},"list":{"description":"响应数据","type":"array","items":{"$ref":"#/components/schemas/AuthorizedResourceDto"}}},"required":["totalCount","list"]},"AuthorizedResourcePaginatedRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/AuthorizedResourcePagingDto"}]}},"required":["statusCode","message","data"]},"UpdateUserProfileDto":{"type":"object","properties":{"name":{"type":"string","description":"用户真实名称,不具备唯一性","example":"张三"},"nickname":{"type":"string","description":"昵称","example":"张三"},"photo":{"type":"string","description":"头像链接","example":"https://files.authing.co/authing-console/default-user-avatar.png"},"externalId":{"type":"string","description":"第三方外部 ID","example":"10010"},"birthdate":{"format":"date-time","type":"string","description":"出生日期","example":"2022-06-03"},"country":{"type":"string","description":"所在国家","example":"CN"},"province":{"type":"string","description":"所在省份","example":"BJ"},"city":{"type":"string","description":"所在城市","example":"BJ"},"address":{"type":"string","description":"所处地址","example":"北京朝阳"},"streetAddress":{"type":"string","description":"所处街道地址","example":"北京朝阳区 xxx 街道"},"postalCode":{"type":"string","description":"邮政编码号","example":"438100"},"gender":{"type":"string","description":"性别","enum":["M","F","U"],"example":"M","default":"U"},"username":{"type":"string","description":"用户名,用户池内唯一","example":"bob"},"company":{"type":"string","description":"所在公司","example":"steamory"},"customData":{"type":"object","description":"自定义数据,传入的对象中的 key 必须先在用户池定义相关自定义字段","example":{"school":"北京大学","age":22}},"identityNumber":{"type":"string","description":"用户身份证号码","example":"420421xxxxxxxx1234"}}},"BindEmailDto":{"type":"object","properties":{"email":{"type":"string","description":"邮箱,不区分大小写。","example":"test@example.com"},"passCode":{"type":"string","description":"邮箱验证码,一个邮箱验证码只能使用一次,且有一定有效时间。","example":"123456"}},"required":["email","passCode"]},"UnbindEmailDto":{"type":"object","properties":{"passCode":{"type":"string","description":"邮箱验证码,需要先调用**发送邮件**接口接收验证码。","example":"1234"}},"required":["passCode"]},"BindPhoneDto":{"type":"object","properties":{"phoneNumber":{"type":"string","description":"手机号,不带区号。如果是国外手机号,请在 phoneCountryCode 参数中指定区号。","example":"188xxxx8888"},"passCode":{"type":"string","description":"短信验证码,注意一个短信验证码指南使用一次,且有过期时间。","example":"123456"},"phoneCountryCode":{"type":"string","description":"手机区号,中国大陆手机号可不填。Authing 短信服务暂不内置支持国际手机号,你需要在 Authing 控制台配置对应的国际短信服务。完整的手机区号列表可参阅 https://en.wikipedia.org/wiki/List_of_country_calling_codes。","example":"+86"}},"required":["phoneNumber","passCode"]},"UnbindPhoneDto":{"type":"object","properties":{"passCode":{"type":"string","description":"短信验证码,需要先调用**发送短信**接口接收验证码。","example":"1234"}},"required":["passCode"]},"GetSecurityInfoDto":{"type":"object","properties":{"passwordSecurityLevel":{"type":"number","description":"密码强度等级"},"mfaEnrolled":{"type":"boolean","description":"是否绑定了 MFA"},"passwordSet":{"type":"boolean","description":"是否设置了密码"},"emailBinded":{"type":"boolean","description":"是否绑定了邮箱"},"phoneBinded":{"type":"boolean","description":"是否绑定了手机号"},"securityScore":{"type":"number","description":"账号等级评分"}},"required":["passwordSecurityLevel","mfaEnrolled","passwordSet","emailBinded","phoneBinded","securityScore"]},"GetSecurityInfoRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/GetSecurityInfoDto"}]}},"required":["statusCode","message","data"]},"UpdatePasswordDto":{"type":"object","properties":{"newPassword":{"type":"string","description":"新密码"},"oldPassword":{"type":"string","description":"原始密码,如果用户当前设置了密码,此参数必填。"},"passwordEncryptType":{"type":"string","description":"密码加密类型,支持使用 RSA256 和国密 SM2 算法进行加密。默认为 `none` 不加密。\n- `none`: 不对密码进行加密,使用明文进行传输。\n- `rsa`: 使用 RSA256 算法对密码进行加密,需要使用 Authing 服务的 RSA 公钥进行加密,请阅读**介绍**部分了解如何获取 Authing 服务的 RSA256 公钥。\n- `sm2`: 使用 [国密 SM2 算法](https://baike.baidu.com/item/SM2/15081831) 对密码进行加密,需要使用 Authing 服务的 SM2 公钥进行加密,请阅读**介绍**部分了解如何获取 Authing 服务的 SM2 公钥。\n ","enum":["sm2","rsa","none"],"example":"none","default":"none"}},"required":["newPassword"]},"UpdateEmailByEmailPassCodeDto":{"type":"object","properties":{"newEmail":{"type":"string","description":"新邮箱","example":"new@example.com"},"newEmailPassCode":{"type":"string","description":"新邮箱验证码","example":"123456"},"oldEmail":{"type":"string","description":"旧邮箱,如果用户池开启了修改邮箱需要验证之前的邮箱,此参数必填。","example":"old@example.com"},"oldEmailPassCode":{"type":"string","description":"旧邮箱验证码,如果用户池开启了修改邮箱需要验证之前的邮箱,此参数必填。","example":"123456"}},"required":["newEmail","newEmailPassCode"]},"VerifyUpdateEmailRequestDto":{"type":"object","properties":{"verifyMethod":{"type":"string","description":"修改当前邮箱使用的验证手段:\n- `EMAIL_PASSCODE`: 通过邮箱验证码进行验证,当前只支持这种验证方式。\n ","enum":["EMAIL_PASSCODE"],"example":"EMAIL_PASSCODE"},"emailPassCodePayload":{"description":"使用邮箱验证码方式验证的数据","allOf":[{"$ref":"#/components/schemas/UpdateEmailByEmailPassCodeDto"}]}},"required":["verifyMethod","emailPassCodePayload"]},"VerifyUpdateEmailRequestData":{"type":"object","properties":{"updateEmailToken":{"type":"string","description":"用于修改当前邮箱的 token,你需要使用此 token 调用**修改邮箱**接口。"},"tokenExpiresIn":{"type":"number","description":"Token 有效时间,时间为 60 秒。","example":60}},"required":["updateEmailToken","tokenExpiresIn"]},"VerifyUpdateEmailRequestRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/VerifyUpdateEmailRequestData"}]}},"required":["statusCode","message","data"]},"UpdateEmailDto":{"type":"object","properties":{"updateEmailToken":{"type":"string","description":"用于临时修改邮箱的 token,可从**发起修改邮箱的验证请求**接口获取。","example":"xxxx"}},"required":["updateEmailToken"]},"UpdatePhoneByPhonePassCodeDto":{"type":"object","properties":{"newPhoneNumber":{"type":"string","description":"新手机号码,不带区号。如果是国外手机号,请在 newPhoneCountryCode 参数中指定区号。","example":"188xxxx8888"},"newPhonePassCode":{"type":"string","description":"验证码","example":"123456"},"newPhoneCountryCode":{"type":"string","description":"手机区号,中国大陆手机号可不填。Authing 短信服务暂不内置支持国际手机号,你需要在 Authing 控制台配置对应的国际短信服务。完整的手机区号列表可参阅 https://en.wikipedia.org/wiki/List_of_country_calling_codes。","example":"+86"},"oldPhoneNumber":{"type":"string","description":"旧手机号码,不带区号。如果是国外手机号,请在 oldPhoneCountryCode 参数中指定区号。如果用户池开启了修改手机号需要验证之前的手机号,此参数必填。","example":"188xxxx8888"},"oldPhonePassCode":{"type":"string","description":"旧手机号的验证码,如果用户池开启了修改手机号需要验证之前的手机号,此参数必填","example":"123456"},"oldPhoneCountryCode":{"type":"string","description":"手机区号,中国大陆手机号可不填。Authing 短信服务暂不内置支持国际手机号,你需要在 Authing 控制台配置对应的国际短信服务。完整的手机区号列表可参阅 https://en.wikipedia.org/wiki/List_of_country_calling_codes。","example":"+86"}},"required":["newPhoneNumber","newPhonePassCode"]},"VerifyUpdatePhoneRequestDto":{"type":"object","properties":{"verifyMethod":{"type":"string","description":"修改手机号的验证方式:\n- `PHONE_PASSCODE`: 使用短信验证码的方式进行验证,当前仅支持这一种方式。\n ","enum":["PHONE_PASSCODE"]},"phonePassCodePayload":{"description":"使用手机号验证码方式验证的数据","allOf":[{"$ref":"#/components/schemas/UpdatePhoneByPhonePassCodeDto"}]}},"required":["verifyMethod","phonePassCodePayload"]},"VerifyUpdatePhoneRequestData":{"type":"object","properties":{"updatePhoneToken":{"type":"string","description":"用于修改当前手机号 token,你需要使用此 token 请求**修改手机号**的接口。"},"tokenExpiresIn":{"type":"number","description":"过期时间"}},"required":["updatePhoneToken","tokenExpiresIn"]},"VerifyUpdatePhoneRequestRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/VerifyUpdatePhoneRequestData"}]}},"required":["statusCode","message","data"]},"UpdatePhoneDto":{"type":"object","properties":{"updatePhoneToken":{"type":"string","description":"用于临时修改手机号的 token,可从**发起修改手机号的验证请求**接口获取。","example":"xxxx"}},"required":["updatePhoneToken"]},"ResetPasswordByPhonePassCodeDto":{"type":"object","properties":{"phoneNumber":{"type":"string","description":"此账号绑定的手机号,不带区号。如果是国外手机号,请在 phoneCountryCode 参数中指定区号。","example":"188xxxx8888"},"passCode":{"type":"string","description":"短信验证码,一个短信验证码只能使用一次,有效时间为一分钟。你需要通过**发送短信**接口获取。","example":"123456"},"phoneCountryCode":{"type":"string","description":"手机区号,中国大陆手机号可不填。Authing 短信服务暂不内置支持国际手机号,你需要在 Authing 控制台配置对应的国际短信服务。完整的手机区号列表可参阅 https://en.wikipedia.org/wiki/List_of_country_calling_codes。","example":"+86"}},"required":["phoneNumber","passCode"]},"ResetPasswordByEmailPassCodeDto":{"type":"object","properties":{"email":{"type":"string","description":"此账号绑定的邮箱,不区分大小写。"},"passCode":{"type":"string","description":"邮箱验证码,一个短信验证码只能使用一次,默认有效时间为 5 分钟。你需要通过**发送邮件**接口获取。"}},"required":["passCode"]},"VerifyResetPasswordRequestDto":{"type":"object","properties":{"verifyMethod":{"type":"string","description":"忘记密码请求使用的验证手段:\n- `EMAIL_PASSCODE`: 通过邮箱验证码进行验证\n- `PHONE_PASSCODE`: 通过手机号验证码进行验证\n ","enum":["EMAIL_PASSCODE","PHONE_PASSCODE"],"example":"EMAIL_PASSCODE"},"phonePassCodePayload":{"description":"使用手机号验证码验证的数据","allOf":[{"$ref":"#/components/schemas/ResetPasswordByPhonePassCodeDto"}]},"emailPassCodePayload":{"description":"使用邮箱验证码验证的数据","allOf":[{"$ref":"#/components/schemas/ResetPasswordByEmailPassCodeDto"}]}},"required":["verifyMethod"]},"ResetPasswordVerify":{"type":"object","properties":{"passwordResetToken":{"type":"string","description":"用于重置密码 token"},"tokenExpiresIn":{"type":"number","description":"过期时间"}},"required":["passwordResetToken","tokenExpiresIn"]},"PasswordResetVerifyResp":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/ResetPasswordVerify"}]}},"required":["statusCode","message","data"]},"ResetPasswordDto":{"type":"object","properties":{"passwordResetToken":{"type":"string","description":"重置密码的 token"},"password":{"type":"string","description":"密码"},"passwordEncryptType":{"type":"string","description":"密码加密类型,支持使用 RSA256 和国密 SM2 算法进行加密。默认为 `none` 不加密。\n- `none`: 不对密码进行加密,使用明文进行传输。\n- `rsa`: 使用 RSA256 算法对密码进行加密,需要使用 Authing 服务的 RSA 公钥进行加密,请阅读**介绍**部分了解如何获取 Authing 服务的 RSA256 公钥。\n- `sm2`: 使用 [国密 SM2 算法](https://baike.baidu.com/item/SM2/15081831) 对密码进行加密,需要使用 Authing 服务的 SM2 公钥进行加密,请阅读**介绍**部分了解如何获取 Authing 服务的 SM2 公钥。\n ","enum":["sm2","rsa","none"],"example":"none","default":"none"}},"required":["passwordResetToken","password"]},"DeleteAccountByPhonePassCodeDto":{"type":"object","properties":{"phoneNumber":{"type":"string","description":"此账号绑定的手机号,不带区号。如果是国外手机号,请在 phoneCountryCode 参数中指定区号。","example":"188xxxx8888"},"passCode":{"type":"string","description":"短信验证码,一个短信验证码只能使用一次,有效时间为一分钟。你需要通过**发送短信**接口获取。","example":"123456"},"phoneCountryCode":{"type":"string","description":"手机区号","example":"+86"}},"required":["phoneNumber","passCode"]},"DeleteAccountByEmailPassCodeDto":{"type":"object","properties":{"email":{"type":"string","description":"此账号绑定的邮箱,不区分大小写。"},"passCode":{"type":"string","description":"邮箱验证码,一个短信验证码只能使用一次,默认有效时间为 5 分钟。你需要通过**发送邮件**接口获取。"}},"required":["passCode"]},"DeleteAccountByPasswordDto":{"type":"object","properties":{"password":{"type":"string","description":"用户密码"},"passwordEncryptType":{"type":"string","description":"密码加密类型,支持使用 RSA256 和国密 SM2 算法进行加密。默认为 `none` 不加密。\n- `none`: 不对密码进行加密,使用明文进行传输。\n- `rsa`: 使用 RSA256 算法对密码进行加密,需要使用 Authing 服务的 RSA 公钥进行加密,请阅读**介绍**部分了解如何获取 Authing 服务的 RSA256 公钥。\n- `sm2`: 使用 [国密 SM2 算法](https://baike.baidu.com/item/SM2/15081831) 对密码进行加密,需要使用 Authing 服务的 SM2 公钥进行加密,请阅读**介绍**部分了解如何获取 Authing 服务的 SM2 公钥。\n ","enum":["sm2","rsa","none"],"example":"none","default":"none"}},"required":["password"]},"VerifyDeleteAccountRequestDto":{"type":"object","properties":{"verifyMethod":{"type":"string","description":"注销账号的验证手段:\n- `PHONE_PASSCODE`: 使用手机号验证码方式进行验证。\n- `EMAIL_PASSCODE`: 使用邮箱验证码方式进行验证。\n- `PASSWORD`: 如果用户既没有绑定手机号又没有绑定邮箱,可以使用密码作为验证手段。\n ","enum":["PHONE_PASSCODE","EMAIL_PASSCODE","PASSWORD"],"example":"PHONE_PASSCODE"},"phonePassCodePayload":{"description":"使用手机号验证码验证的数据","allOf":[{"$ref":"#/components/schemas/DeleteAccountByPhonePassCodeDto"}]},"emailPassCodePayload":{"description":"使用邮箱验证码验证的数据","allOf":[{"$ref":"#/components/schemas/DeleteAccountByEmailPassCodeDto"}]},"passwordPayload":{"description":"使用密码验证的数据","allOf":[{"$ref":"#/components/schemas/DeleteAccountByPasswordDto"}]}},"required":["verifyMethod"]},"VerifyDeleteAccountRequestDataDto":{"type":"object","properties":{"deleteAccountToken":{"type":"string","description":"用于注销账号的临时 Token,你需要调用**注销账号**接口执行实际注销账号操作。","example":"xxxx"},"tokenExpiresIn":{"type":"number","description":"Token 有效时间,默认为 60 秒。","example":60}},"required":["deleteAccountToken","tokenExpiresIn"]},"VerifyDeleteAccountRequestRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/VerifyDeleteAccountRequestDataDto"}]}},"required":["statusCode","message","data"]},"DeleteAccounDto":{"type":"object","properties":{"deleteAccountToken":{"type":"string","description":"注销账户的 token"}},"required":["deleteAccountToken"]},"ListPublicAccountDataDto":{"type":"object","properties":{"userId":{"type":"string","description":"账号 ID","example":"623c20b2a062aaaaf41b17da"},"avatar":{"type":"string","description":"账号头像"},"displayName":{"type":"string","description":"显示名称"},"usertype":{"type":"string","description":"用户类型:1 个人用户,2 公共账号","enum":["1","2"]}},"required":["userId"]},"GetUserSelectLoginPublicAccountsOriginUserDto":{"type":"object","properties":{"userId":{"type":"string","description":"账号 ID","example":"623c20b2a062aaaaf41b17da"},"avatar":{"type":"string","description":"账号头像"},"displayName":{"type":"string","description":"显示名称"},"usertype":{"type":"string","description":"用户类型:1 个人用户,2 公共账号","enum":["1","2"]}},"required":["userId"]},"GetUserSelectLoginPublicAccountsDataDto":{"type":"object","properties":{"publicAccounts":{"description":"公共账号列表","example":[],"type":"array","items":{"$ref":"#/components/schemas/ListPublicAccountDataDto"}},"originUser":{"description":"个人账号信息","allOf":[{"$ref":"#/components/schemas/GetUserSelectLoginPublicAccountsOriginUserDto"}]}},"required":["publicAccounts"]},"GetPublicAccountDataRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","type":"array","items":{"$ref":"#/components/schemas/GetUserSelectLoginPublicAccountsDataDto"}}},"required":["statusCode","message","data"]},"SystmeInfoRSAConfig":{"type":"object","properties":{"publicKey":{"type":"string","description":"RSA256 公钥","example":"xxxxxxxxxxxxxxxxxxxxxx"}},"required":["publicKey"]},"SystmeInfoSM2Config":{"type":"object","properties":{"publicKey":{"type":"string","description":"SM2 公钥","example":"xxxxxxxxxxxxxxxxxxxxxx"}},"required":["publicKey"]},"SystmeInfoVersion":{"type":"object","properties":{"server":{"type":"string","description":"Authing 核心服务版本号","example":"2.0.0"},"console":{"type":"string","description":"Authing 控制台版本号","example":"2.0.0"},"login":{"type":"string","description":"Authing 托管登录页版本号","example":"2.0.0"}},"required":["server","console","login"]},"SystemInfoResp":{"type":"object","properties":{"rsa":{"description":"RSA256 加密配置信息","allOf":[{"$ref":"#/components/schemas/SystmeInfoRSAConfig"}]},"sm2":{"description":"国密 SM2 加密配置信息","allOf":[{"$ref":"#/components/schemas/SystmeInfoSM2Config"}]},"version":{"description":"国密 SM2 加密配置信息","allOf":[{"$ref":"#/components/schemas/SystmeInfoVersion"}]},"publicIps":{"description":"Authing 服务对外 IP 列表","type":"array","items":{"type":"string"}}},"required":["rsa","sm2","version","publicIps"]},"CountryDetailInfo":{"type":"object","properties":{"alpha2":{"type":"string","description":"[ISO 3166 国际标准](https://www.iban.com/country-codes)中国家的 Alpha-2 简称","example":"CN"},"alpha3":{"type":"string","description":"[ISO 3166 国际标准](https://www.iban.com/country-codes)中国家的 Alpha-3 简称","example":"CHN"},"phoneCountryCode":{"type":"string","description":"国家手机区号","example":"+86"},"flag":{"type":"string","description":"国旗图标","example":"🇨🇳"},"name":{"description":"名称,多语言结构,目前只支持中文和英文","example":{"zh-CN":{"enabled":false,"value":"中国"},"en-US":{"enabled":false,"value":"China"}},"allOf":[{"$ref":"#/components/schemas/LangObject"}]}},"required":["alpha2","alpha3","phoneCountryCode","flag","name"]},"GetCountryListRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","type":"array","items":{"$ref":"#/components/schemas/CountryDetailInfo"}}},"required":["statusCode","message","data"]},"UploadDto":{"type":"object","properties":{"folder":{"type":"string","description":"上传的目录","example":"photos"},"isPrivate":{"type":"boolean","description":"是否为私有资源","example":false}}},"UploadDataDto":{"type":"object","properties":{"key":{"type":"string","description":"key"},"url":{"type":"string","description":"url"}},"required":["key","url"]},"UploadRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/UploadDataDto"}]}},"required":["statusCode","message","data"]},"CheckPermissionStringResourceDto":{"type":"object","properties":{"action":{"type":"string","description":"数据资源权限操作, read、get、write 等动作","example":"get"},"resources":{"description":"字符串数据资源路径列表,","example":["exampleStringResource1","exampleStringResource2"],"type":"array","items":{"type":"string","maxLength":50,"minLength":1}}},"required":["action","resources"]},"CheckResourcePermissionRespDto":{"type":"object","properties":{"namespaceCode":{"type":"string","description":"权限空间 Code","example":"examplePermissionNamespace"},"action":{"type":"string","description":"数据资源权限操作","example":"get"},"resource":{"type":"string","description":"资源路径","example":"exampleResource"},"enabled":{"type":"boolean","description":"用户在某个权限空间下是否具有该数据资源的某个操作","example":true}},"required":["namespaceCode","action","resource","enabled"]},"CheckResourcePermissionDataDto":{"type":"object","properties":{"checkResultList":{"description":"检查结果列表","type":"array","items":{"$ref":"#/components/schemas/CheckResourcePermissionRespDto"}}},"required":["checkResultList"]},"CheckResourcePermissionsRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/CheckResourcePermissionDataDto"}]}},"required":["statusCode","message","data"]},"CheckPermissionArrayResourceDto":{"type":"object","properties":{"action":{"type":"string","description":"数据资源权限操作, read、get、write 等动作","example":"get"},"resources":{"description":"数组数据资源路径列表,","example":["exampleArrayResource1","exampleArrayResource2"],"type":"array","items":{"type":"string","maxLength":50,"minLength":1}}},"required":["action","resources"]},"CheckPermissionTreeResourceDto":{"type":"object","properties":{"action":{"type":"string","description":"数据资源权限操作, read、get、write 等动作","example":"get"},"resources":{"description":"树数据资源路径列表,","example":["treeResourceCode1/StructCode1/resourceStructChildrenCode1","treeResourceCode1/StructCode1/resourceStructChildrenCode2","treeResourceCode1/StructCode2"],"type":"array","items":{"type":"string","maxLength":50,"minLength":1}}},"required":["action","resources"]},"StrAuthorize":{"type":"object","properties":{"value":{"type":"string","description":"字符串资源 Value","example":"示例字符串资源 Value"},"actions":{"description":"字符串资源操作列表","example":["read","get"],"type":"array","items":{"type":"string"}}},"required":["value","actions"]},"ArrayAuthorize":{"type":"object","properties":{"values":{"description":"数组资源 Value 列表","example":["value0","value1"],"type":"array","items":{"type":"string"}},"actions":{"description":"数组资源操作列表","example":["read","get"],"type":"array","items":{"type":"string"}}},"required":["values","actions"]},"TreeAuthBo":{"type":"object","properties":{"nodePath":{"type":"string","description":"树资源节点路径","example":"/treeCode1/treeCode11"},"nodeName":{"type":"string","description":"树资源节点名称","example":"示例树资源节点名称"},"nodeActions":{"description":"树资源节点操作权限列表","example":["read","get"],"type":"array","items":{"type":"string"}},"nodeValue":{"type":"string","description":"树资源节点 Value","example":"示例树资源节点 Value"}},"required":["nodePath","nodeName","nodeActions"]},"TreeAuthorize":{"type":"object","properties":{"authList":{"description":"树资源授权列表","type":"array","items":{"$ref":"#/components/schemas/TreeAuthBo"}}},"required":["authList"]},"OpenResource":{"type":"object","properties":{"resourceCode":{"type":"string","description":"数据策略下所授权的数据资源 Code","example":"resourceCode"},"resourceType":{"type":"string","description":"数据策略下所授权的数据资源类型,目前支持树结构(TREE)、字符串(STRING)、数组(ARRAY)三种类型,根据不同的类型返回不同的结构。\n- `STRING`: 字符串类型结果 StrAuthorize\n- `ARRAY`: 数组类型 ArrayAuthorize\n- `TREE`: 树类型 TreeAuthorize ","enum":["TREE","STRING","ARRAY"],"example":"STRING"},"strAuthorize":{"description":"数据策略的字符串资源","allOf":[{"$ref":"#/components/schemas/StrAuthorize"}]},"arrAuthorize":{"description":"数据策略的数组资源","allOf":[{"$ref":"#/components/schemas/ArrayAuthorize"}]},"treeAuthorize":{"description":"数据策略的树资源","allOf":[{"$ref":"#/components/schemas/TreeAuthorize"}]}},"required":["resourceCode","resourceType"]},"UserAuthResourceListDto":{"type":"object","properties":{"userId":{"type":"string","description":"数据策略授权的用户 ID","example":"6301cexxxxxxxxxxxxxxxxx78"},"namespaceCode":{"type":"string","description":"数据策略授权的权限空间 Code","example":"examplePermissionNamespace"},"resourceList":{"description":"用户在权限空间下所有的数据策略资源列表","type":"array","items":{"$ref":"#/components/schemas/OpenResource"}}},"required":["userId","namespaceCode"]},"GetUserAuthResourceListDataDto":{"type":"object","properties":{"userPermissionList":{"description":"用户权限列表","type":"array","items":{"$ref":"#/components/schemas/UserAuthResourceListDto"}}},"required":["userPermissionList"]},"GetUserAuthResourceListRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/GetUserAuthResourceListDataDto"}]}},"required":["statusCode","message","data"]},"GetUserAuthResourcePermissionListDto":{"type":"object","properties":{"resources":{"description":"数据资源路径列表,**树资源需到具体树节点**","example":["strResourceCode","arrResourceCode","treeResourceCode/StructCode1/resourceStructChildrenCode1"],"type":"array","items":{"type":"string","maxLength":50,"minLength":1}}},"required":["resources"]},"GetUserAuthResourcePermissionList":{"type":"object","properties":{"namespaceCode":{"type":"string","description":"当前应用 Id","example":"examplePermissionNamespace"},"actions":{"description":"数据资源权限操作列表","example":["get","read","write","delete"],"type":"array","items":{"type":"string"}},"resource":{"type":"string","description":"数据资源路径","example":"treeResourceCode1"}},"required":["namespaceCode","actions","resource"]},"GetUserAuthResourcePermissionListDataDto":{"type":"object","properties":{"permissionList":{"description":"权限列表","type":"array","items":{"$ref":"#/components/schemas/GetUserAuthResourcePermissionList"}}},"required":["permissionList"]},"GetUserAuthResourcePermissionListRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/GetUserAuthResourcePermissionListDataDto"}]}},"required":["statusCode","message","data"]},"GetUserAuthResourceStructDto":{"type":"object","properties":{"resource":{"type":"string","description":"数据资源 Code","example":"exampleDataResourceCode"}},"required":["resource"]},"StrResourceAuthAction":{"type":"object","properties":{"value":{"type":"string","description":"字符串数据资源的 Value","example":"resourceCode"},"actions":{"description":"字符串数据资源的 actions","example":["resourceCode"],"type":"array","items":{"type":"string"}}}},"ArrResourceAuthAction":{"type":"object","properties":{"values":{"description":"数组数据资源的 values","example":["resourceCode"],"type":"array","items":{"type":"string"}},"actions":{"description":"数组数据资源的 actions","example":["resourceCode"],"type":"array","items":{"type":"string"}}}},"TreeStructs":{"type":"object","properties":{"code":{"type":"string","description":"树资源节点 Code, 同层级唯一","example":"123","maxLength":50},"name":{"type":"string","description":"树资源节点名称 ,同层级唯一","example":"树数据资源","maxLength":50},"value":{"type":"string","description":"树资源节点 Value","example":"示例树资源策略节点","maxLength":1000},"actions":{"description":"树数据资源策略节点 actions ","example":"read","type":"array","items":{"type":"string"}},"children":{"description":"子节点数据,子节点数据最多五个层级","example":[{"code":"code1","name":"子节点1","value":"子节点值","actions":["Create"],"children":[{"code":"code2","name":"子节点2","value":"子节点2值","actions":["get"]}]}],"type":"array","items":{"$ref":"#/components/schemas/TreeStructs"}}},"required":["code","name"]},"TreeResourceAuthAction":{"type":"object","properties":{"nodeAuthActionList":{"description":"树结构节点列表","type":"array","items":{"$ref":"#/components/schemas/TreeStructs"}}}},"GetUserAuthResourceStructDataDto":{"type":"object","properties":{"namespaceCode":{"type":"string","description":"权限空间 Code","example":"namespaceCode"},"resourceCode":{"type":"string","description":"数据资源 Code","example":"resourceCode"},"resourceType":{"type":"string","description":"数据资源类型,目前支持树结构(TREE)、字符串(STRING)、数组(ARRAY)三种类型,根据不同的类型返回不同的结构。\n- `STRING`: 字符串类型结果 StrResourceAuthAction\n- `ARRAY`: 数组类型 ArrResourceAuthAction\n- `TREE`: 树类型 TreeResourceAuthAction ","enum":["TREE","STRING","ARRAY"],"example":"STRING"},"strResourceAuthAction":{"description":"字符串资源授权","allOf":[{"$ref":"#/components/schemas/StrResourceAuthAction"}]},"arrResourceAuthAction":{"description":"数组资源授权","allOf":[{"$ref":"#/components/schemas/ArrResourceAuthAction"}]},"treeResourceAuthAction":{"description":"树资源授权","allOf":[{"$ref":"#/components/schemas/TreeResourceAuthAction"}]}},"required":["namespaceCode","resourceCode","resourceType"]},"GetUserAuthResourceStructRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/GetUserAuthResourceStructDataDto"}]}},"required":["statusCode","message","data"]},"PublicKeyCredentialDescriptorDto":{"type":"object","properties":{"id":{"type":"string","description":"允许的凭证 ID"},"transports":{"description":"凭证所需的认证器与用户代理的通信方式:\n- `ble`: 可以通过蓝牙连接的认证器\n- `internal`: 平台内置的、无法移除的认证器\n- `nfc`: 可以通过 NFC 连接的认证器\n- `usb`: 可以通过 USB 连接的认证器\n","type":"array","items":{"type":"string"}},"type":{"type":"string","description":"固定值,public-key","example":"public-key"}},"required":["id","transports","type"]},"PublicKeyCredentialRequestOptionsDto":{"type":"object","properties":{"challenge":{"type":"string","description":"挑战码, base64Url 编码"},"allowCredentials":{"description":"认证器认证参数","type":"array","items":{"$ref":"#/components/schemas/PublicKeyCredentialDescriptorDto"}},"rpId":{"type":"string","description":"信赖方 ID,和注册认证器时一致"},"timeout":{"type":"number","description":"超时时间(毫秒值)","example":"60000"}},"required":["challenge","rpId","timeout"]},"AuthenticationOptionsDto":{"type":"object","properties":{"authenticationOptions":{"description":"认证器认证参数","allOf":[{"$ref":"#/components/schemas/PublicKeyCredentialRequestOptionsDto"}]},"ticket":{"type":"string","description":"ticket 需回传,用作向服务器发起验证从认证器获得的认证结果"}},"required":["authenticationOptions","ticket"]},"GetAuthenticationOptionsRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/AuthenticationOptionsDto"}]}},"required":["statusCode","message","data"]},"AuthenticatorAssertionResponseDto":{"type":"object","properties":{"authenticatorData":{"type":"string","description":"认证器信息,包含认证状态、签名计数等"},"clientDataJSON":{"type":"string","description":"客户端数据,包含 origin(即凭证请求来源)、挑战码等信息"},"signature":{"type":"string","description":"认证器签名"},"userHandle":{"type":"string","description":"创建凭证时的用户 ID"}},"required":["authenticatorData","clientDataJSON","signature","userHandle"]},"AuthenticationCredentialDto":{"type":"object","properties":{"id":{"type":"string","description":"Base64URL 编码的凭证 ID"},"rawId":{"type":"string","description":"原始凭证 ID"},"response":{"description":"固定值,'public-key'","allOf":[{"$ref":"#/components/schemas/AuthenticatorAssertionResponseDto"}]},"type":{"type":"string","description":"固定值,'public-key'","example":"public-key"}},"required":["id","rawId","response","type"]},"SignInByWebAuthnOptionsDto":{"type":"object","properties":{"scope":{"type":"string","description":"需要请求的权限,必须包含 openid。如果需要获取手机号和 email 需要包含 phone email;如果需要 refresh_token 需要包含 offline_access。多个 scope 请用空格分隔。id_token 解码后的内容中会包含这些 scope 对应的用户信息相关的字段。\n- `openid`: 必须包含。\n- `profile`: 返回 birthdate,family_name,gender,given_name,locale,middle_name,name,nickname,picture,preferred_username,profile,updated_at,website,zoneinfo 字段。\n- `username`: 返回 username。\n- `email`: 返回 email,email_verified。\n- `phone`: 返回 phone_number, phone_number_verified。\n- `offline_access`: 如果存在此参数,token 接口会返回 refresh_token 字段。\n- `roles`: 返回用户的角色列表。\n- `external_id`: 用户在原有系统的用户 ID。\n- `extended_fields`: 返回用户的扩展字段信息,内容为一个对象,key 为扩展字段名,value 为扩展字段值。\n- `tenant_id`: 返回用户的租户 ID。\n ","example":"openid profile"},"context":{"type":"object","description":"额外请求上下文,将会传递到认证前和认证后的 [Pipeline](https://docs.authing.cn/v2/guides/pipeline/) 的 `context` 对象中。了解[如何在 Pipeline 的 `context` 参数中获取传入的额外 context](https://docs.authing.cn/v2/guides/pipeline/context-object.html)。","example":{"source":"utm"}},"customData":{"type":"object","description":"设置额外的用户自定义数据,你需要先在 Authing 控制台[配置自定义数据](https://docs.authing.cn/v2/guides/users/user-defined-field/)。","example":{"school":"pku","age":"20"}}}},"VerifyAuthenticationDto":{"type":"object","properties":{"authenticationCredential":{"description":"认证器凭证信息","allOf":[{"$ref":"#/components/schemas/AuthenticationCredentialDto"}]},"ticket":{"type":"string","description":"从 获取 WebAuthn 认证请求初始化参数接口 获得的 ticket"},"options":{"description":"可选参数","allOf":[{"$ref":"#/components/schemas/SignInByWebAuthnOptionsDto"}]}},"required":["authenticationCredential","ticket"]},"VerifyAuthenticationResultDto":{"type":"object","properties":{"verified":{"type":"boolean","description":"验证认证器登录认证的结果,true 验证成功","example":true},"tokenSet":{"description":"验证认证器登录认证通过时,即 verified = true,此数据才会返回。","allOf":[{"$ref":"#/components/schemas/LoginTokenResponseDataDto"}]}},"required":["verified"]},"VerifyAuthenticationResultRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/VerifyAuthenticationResultDto"}]}},"required":["statusCode","message","data"]},"PublicKeyCredentialParametersDto":{"type":"object","properties":{"alg":{"type":"number","description":"一个负整数,用于标明算法"},"type":{"type":"string","description":"固定值,public-key","example":"public-key"}},"required":["alg","type"]},"PublicKeyCredentialRpEntityDto":{"type":"object","properties":{"id":{"type":"string","description":"信赖方 domain","example":"example.com"},"name":{"type":"string","description":"信赖方名称"}},"required":["id","name"]},"PublicKeyCredentialUserEntityDto":{"type":"object","properties":{"id":{"type":"string","description":"用户 ID"},"name":{"type":"string","description":"用户名","example":"zhangsan"},"displayName":{"type":"string","description":"用于显示的用户名称","example":"张三"}},"required":["id","name","displayName"]},"PublicKeyCredentialCreationOptionsDto":{"type":"object","properties":{"challenge":{"type":"string","description":"挑战码, base64Url 编码"},"excludeCredentials":{"description":"用于标识要排除的凭证,可以避免同一个用户多次注册同一个认证器","type":"array","items":{"$ref":"#/components/schemas/PublicKeyCredentialDescriptorDto"}},"pubKeyCredParams":{"description":"算法列表,指明信赖方接受哪些签名算法","type":"array","items":{"$ref":"#/components/schemas/PublicKeyCredentialParametersDto"}},"rp":{"description":"信赖方信息","allOf":[{"$ref":"#/components/schemas/PublicKeyCredentialRpEntityDto"}]},"timeout":{"type":"number","description":"超时时间(毫秒值)","example":"60000"},"user":{"description":"用户信息","allOf":[{"$ref":"#/components/schemas/PublicKeyCredentialUserEntityDto"}]}},"required":["challenge","excludeCredentials","pubKeyCredParams","rp","timeout","user"]},"RegistrationOptionsDto":{"type":"object","properties":{"registrationOptions":{"description":"认证器生成公钥凭证的参数","allOf":[{"$ref":"#/components/schemas/PublicKeyCredentialCreationOptionsDto"}]},"ticket":{"type":"string","description":"ticket 需回传,用作向服务器发起验证从认证器获得的创建凭证时的结果","example":""}},"required":["registrationOptions","ticket"]},"GetRegistrationOptionsRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/RegistrationOptionsDto"}]}},"required":["statusCode","message","data"]},"AuthenticatorAttestationResponseDto":{"type":"object","properties":{"attestationObject":{"type":"string","description":"CBOR 编码的认证器数据,包含凭证公钥、凭证 ID、签名、签名计数等信息"},"clientDataJSON":{"type":"string","description":"客户端数据,包含 origin(即凭证请求来源)、挑战等信息"}},"required":["attestationObject","clientDataJSON"]},"RegistrationCredentialDto":{"type":"object","properties":{"id":{"type":"string","description":"Base64URL 编码的凭证 ID"},"rawId":{"type":"string","description":"原始凭证 ID"},"response":{"description":"供信赖方以供验证与注册的对象","allOf":[{"$ref":"#/components/schemas/AuthenticatorAttestationResponseDto"}]},"transports":{"description":"可选参数,凭证所需的认证器与用户代理的通信方式:\n- `ble`: 可以通过蓝牙连接的认证器\n- `internal`: 平台内置的、无法移除的认证器\n- `nfc`: 可以通过 NFC 连接的认证器\n- `usb`: 可以通过 USB 连接的认证器\n","type":"array","items":{"type":"string"}},"type":{"type":"string","description":"固定值,'public-key'","example":"public-key"}},"required":["id","rawId","response","type"]},"VerifyRegistrationDto":{"type":"object","properties":{"registrationCredential":{"description":"绑定认证器凭证信息","allOf":[{"$ref":"#/components/schemas/RegistrationCredentialDto"}]},"ticket":{"type":"string","description":"获取凭证创建初始化参数时的 ticket"},"authenticatorCode":{"type":"string","description":"凭证信息类型:\n- `FINGERPRINT`: 指纹\n- `FACE`: 人脸\n- `OTHER` 其他","enum":["fingerprint","face","other"],"example":"fingerprint"}},"required":["registrationCredential","ticket"]},"VerifyRegistrationResultDto":{"type":"object","properties":{"verified":{"type":"boolean","description":"验证注册认证器结果"}},"required":["verified"]},"VerifyRegistrationResultRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/VerifyRegistrationResultDto"}]}},"required":["statusCode","message","data"]},"ListDeviceCredentialDto":{"type":"object","properties":{}},"ListWebAuthnAuthenticatorDeviceDataDto":{"type":"object","properties":{"totalCount":{"type":"number","description":"总数","example":true},"list":{"description":"记录条数","example":true,"type":"array","items":{"type":"object"}}},"required":["totalCount","list"]},"CheckDeviceCredentialIdDto":{"type":"object","properties":{}},"WebAuthnCheckValidCredentialsByCredIdsRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","type":"array","items":{"type":"object"}}},"required":["statusCode","message","data"]},"RemoveDeviceCredentialDto":{"type":"object","properties":{}},"WebAuthnRemoveCredentialDto":{"type":"object","properties":{}},"DeviceInfo":{"type":"object","properties":{"deviceId":{"type":"string","description":"设备唯一标识","example":"HZ2F6J3AGNAVSOTV"},"name":{"type":"string","description":"设备名称","example":"打印机"},"version":{"type":"string","description":"系统版本","example":"Android 1.0"},"type":{"type":"string","description":"设备类型","enum":["Browser","Mobile","Desktop"],"example":"Mobile"},"mod":{"type":"string","description":"设备模组","example":"Vig9a"},"os":{"type":"string","description":"设备系统","example":"iOS"},"status":{"type":"string","description":"设备状态","enum":["activated","suspended","deactivated"],"example":"activated","default":"activated"},"userAgent":{"type":"string","description":"用户代理","example":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"}},"required":["deviceId","type"]},"TerminalSessionDto":{"type":"object","properties":{"device":{"description":"设备信息","allOf":[{"$ref":"#/components/schemas/DeviceInfo"}]},"lastLoginTime":{"type":"string","description":"最近登录时间","example":"2023-05-05T19:06:22.434Z"},"lastIp":{"type":"string","description":"最近登录 IP"},"online":{"type":"boolean","description":"是否在线","example":true}},"required":["device","lastLoginTime","online"]},"TerminalSessionRespDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":200},"message":{"type":"string","description":"描述信息","example":"操作成功"},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。详情可以查看开发准备中的 apiCode 细分说明"},"requestId":{"type":"string","description":"请求 ID。当请求失败时会返回。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"data":{"description":"响应数据","type":"array","items":{"$ref":"#/components/schemas/TerminalSessionDto"}}},"required":["statusCode","message","data"]},"UnbindDeviceDto":{"type":"object","properties":{"deviceId":{"type":"string","description":"设备唯一标识"}},"required":["deviceId"]},"RevokeDeviceSessionDto":{"type":"object","properties":{"deviceId":{"type":"string","description":"设备唯一标识"}},"required":["deviceId"]},"WechatMobileAuthByCodeInput":{"type":"object","properties":{"code":{"type":"string","description":"客户端微信授权成功,微信返回当前认证授权码","example":"031OgeHa1lKgnE0wynHa1p77Yu3OgeHq"},"appId":{"type":"string","description":"应用 ID","example":"638c832674d838ecaec4e1e0"},"connId":{"type":"string","description":"身份源连接 ID","example":"63844bec86236e221510f1e7"}},"required":["code"]},"WechatMobileAuthByCodeIdentityInput":{"type":"object","properties":{"code":{"type":"string","description":"客户端微信授权成功,微信返回当前认证授权码","example":"031OgeHa1lKgnE0wynHa1p77Yu3OgeHq"},"appId":{"type":"string","description":"应用 ID","example":"638c832674d838ecaec4e1e0"},"connId":{"type":"string","description":"身份源连接 ID","example":"63844bec86236e221510f1e7"},"options":{"description":"登录参数","example":{"scope":"openid profile"},"allOf":[{"$ref":"#/components/schemas/SignInOptionsDto"}]}},"required":["code"]},"WechatIdentityResolveRespDataDto":{"type":"object","properties":{"methods":{"description":"可选的账号绑定方式。","example":["email-password","username-password","phone-password","phone-code","email-code"],"type":"array","items":{"type":"string"}},"accounts":{"description":"可选的账号列表。","example":["934108e59fbf4d248da1c330328abd6c"],"type":"array","items":{"type":"string"}},"key":{"type":"string","description":"认证中间态。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"}},"required":["key"]},"WechatIdentityResolveRespDto":{"type":"object","properties":{"uniqueId":{"type":"string","description":"异常 ID:需要中间操作才能完成登录。","example":"934108e5-9fbf-4d24-8da1-c330328abd6c"},"code":{"type":"number","description":"(仅用于兼容旧版代码)细分错误码,可通过此错误码得到具体的错误类型。","example":1640},"statusCode":{"type":"number","description":"业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。","example":301},"apiCode":{"type":"number","description":"细分错误码,可通过此错误码得到具体的错误类型。","example":1640},"message":{"type":"string","description":"描述信息","example":"需要执行账号身份绑定"},"data":{"description":"响应数据","allOf":[{"$ref":"#/components/schemas/WechatIdentityResolveRespDataDto"}]}},"required":["statusCode","message","data"]},"BindByRegiserInputApi":{"type":"object","properties":{"action":{"type":"string","description":"操作编码","example":"create-federation-account"},"key":{"type":"string","description":"中间态键","example":"03f4f724-7b5f-44af-92fc-068aea204298"}},"required":["action","key"]},"WechatLoginTokenRespDto":{"type":"object","properties":{"access_token":{"type":"string","description":"接口调用凭据,在限制时间内被授权访问资源 API","example":"eyJhbGciOiJSxxxxx"},"id_token":{"type":"string","description":"用户的身份凭证,解析后会包含用户信息","example":"eyJhbGxxxx"},"refresh_token":{"type":"string","description":"refresh_token 用于获取新的 AccessToken","example":"WPsGJbvpBjqXz6IJIr1UHKyrdVF"},"token_type":{"type":"string","description":"token 类型","example":"bearer"},"expire_in":{"type":"number","description":"过期时间 单位是秒","example":7200},"scope":{"type":"string","description":"登录请求中的 scope","example":"openid address username profile phone email extended_fields offline_access roles"}},"required":["token_type","expire_in","scope"]},"BindByEmailCodeInputApi":{"type":"object","properties":{"email":{"type":"string","description":"邮箱","example":"example@authing.cn"},"code":{"type":"string","description":"邮箱验证码(四位:1234;六位:123456)","example":"1234"},"action":{"type":"string","description":"操作编码","example":"bind-identity-by-email-code"},"key":{"type":"string","description":"中间态键","example":"03f4f724-7b5f-44af-92fc-068aea204298"}},"required":["email","code","action","key"]},"BindByPhoneCodeInputApi":{"type":"object","properties":{"phone":{"type":"string","description":"手机号","example":"19920230104"},"code":{"type":"string","description":"手机验证码(四位:1234;六位:123456)","example":"123456"},"phoneCountryCode":{"type":"string","description":"国家码(标准格式:加号“+”加国家码数字;当前校验兼容历史用户输入习惯。例,中国国家码标准格式为「+86」,历史用户输入记录中存在「86、086、0086」等格式)","example":"86"},"action":{"type":"string","description":"操作编码","example":"bind-identity-by-phone-code"},"key":{"type":"string","description":"中间态键","example":"03f4f724-7b5f-44af-92fc-068aea204298"}},"required":["phone","code","action","key"]},"BindByAccountInputApi":{"type":"object","properties":{"account":{"type":"string","description":"账号(手机/邮箱/用户名)","example":"test_user_2023"},"password":{"type":"string","description":"账号密码","example":"tXPm2vlAEX1RaU2c0GfN9ZGkui3W4XnZhx/vEL7TaYlTK72jV4uVLQdqeSBq\nR85xRdHSMK2hKTYxuUIyUbDd9qvEFF+xWpCjOoGlakrDCVhTN9KCYM+X9L8G\nyuvwteu8d3aP4HlH0gjXRN/3prO/eKeYdxCy8vUDh6b6/R45/r0=\n"},"action":{"type":"string","description":"操作编码","example":"bind-identity-by-password"},"key":{"type":"string","description":"中间态键","example":"03f4f724-7b5f-44af-92fc-068aea204298"}},"required":["account","password","action","key"]},"BindByAccountsInputApi":{"type":"object","properties":{"account":{"type":"string","description":"账号 ID","example":"638ad16fea6354b72cd9a73c"},"action":{"type":"string","description":"操作编码","example":"bind-identity-by-selection"},"key":{"type":"string","description":"中间态键","example":"03f4f724-7b5f-44af-92fc-068aea204298"}},"required":["account","action","key"]},"BindByAccountIdInputApi":{"type":"object","properties":{"accountId":{"type":"string","description":"账号 ID","example":"638ad16fea6354b72cd9a73c"},"action":{"type":"string","description":"操作编码","example":"bind-identity-by-account-id"},"key":{"type":"string","description":"中间态键","example":"03f4f724-7b5f-44af-92fc-068aea204298"}},"required":["accountId","action","key"]}}},"paths":{"/oidc/auth":{"get":{"operationId":"OidcV2SignOnController_frontChannelAuth","x-authing-hidden-from-sdk":true,"summary":"登录","description":"\n此端点会通过浏览器 `302` 跳转的方式跳转到 Authing 托管的在线登录页面\n(例如 https://your_domain.authing.cn), 用户可以选择他希望的认证方式进行认证。你也可以指定 **ext_idp_conn_id** \n参数,指定需要使用的外部身份源连接(社会化登录 + 企业身份源登录)。\n ","parameters":[{"name":"client_id","required":true,"in":"query","description":"Authing 应用 ID","example":"5c9b079883xxxxd55a101082","schema":{"type":"string"}},{"name":"response_type","required":true,"in":"query","description":"如果回调地址是后端服务地址,选择授权码模式,此项选 `code`;如果回调地址是前端 SPA 应用地址,选择隐式模式,此项填可选值为 `id_token`, `id_token token`。你可以在此了解[OIDC 相关规范](https://openid.net/specs/openid-connect-core-1_0.html#AuthorizationExamples)。\n- `code`: 授权码模式,回调时只返回 `code`,再根据 `code` 换取 `id_token` 和 `access_token`。\n- `id_token`: 回调时直接返回 `id_token`,适用于浏览器单页应用无后端服务交互的场景。\n- `id_token token`: 回调时直接返回 `id_token` 和 `access_token`,适用于浏览器单页应用无后端服务交互的场景。\n- `code id_token`: 回调时直接返回 `id_token` 和 `code`。\n- `code token`: 回调时直接返回 `access_token` 和 `code`。\n- `code id_token access_token`: 回调时直接返回 `id_token`、`access_token` 和 `code`。\n","example":"code","schema":{"enum":["none","code","token","id_token token","id_token","code token","code id_token token","code id_token"],"type":"string"}},{"name":"redirect_uri","required":true,"in":"query","description":"回调链接,用户在 OP 认证成功后,OP 会将授权码以 URL query 的形式发送到这个地址。这个值必须出现在控制台配置的回调地址中,否则 OP 不允许向该地址回调。","example":"https://you_domain.com/callback","schema":{"type":"string"}},{"name":"scope","required":true,"in":"query","description":"需要请求的权限,必须包含 openid。如果需要获取手机号和 email 需要包含 phone email;如果需要 refresh_token 需要包含 offline_access。多个 scope 请用空格分隔。id_token 解码后的内容中会包含这些 scope 对应的用户信息相关的字段。\n- `openid`: 必须包含。\n- `profile`: 返回 birthdate,family_name,gender,given_name,locale,middle_name,name,nickname,picture,preferred_username,profile,updated_at,website,zoneinfo 字段。\n- `username`: 返回 username。\n- `email`: 返回 email,email_verified。\n- `phone`: 返回 phone_number, phone_number_verified。\n- `offline_access`: 如果存在此参数,token 接口会返回 refresh_token 字段。\n- `roles`: 返回用户的角色列表。\n- `external_id`: 用户在原有系统的用户 ID。\n- `extended_fields`: 返回用户的扩展字段信息,内容为一个对象,key 为扩展字段名,value 为扩展字段值。\n- `tenant_id`: 返回用户的租户 ID。\n ","example":"openid profile","schema":{"type":"string"}},{"name":"state","required":true,"in":"query","description":"一个随机字符串,用于防范 CSRF 攻击,如果 response 中的 state 值和发送请求之前设置的 state 值不同,说明受到攻击。","example":"6223573295","schema":{"type":"string"}},{"name":"nonce","required":false,"in":"query","description":"一个随机字符串,用于防范 Replay 攻击,implicit 模式下必填。","example":"1831289","schema":{"type":"string"}},{"name":"prompt","required":false,"in":"query","description":"可以为 none,login,consent 或 select_account,指定 Authing 认证服务器与终端用户的交互方式。点此[参考OIDC 规范](https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest)","example":"none","schema":{"type":"string"}},{"name":"response_mode","required":false,"in":"query","description":"响应模式:\n- `query`: `302` 重定向到回调地址,通过查询参数携带相关信息。\n- `fragment`: `302` 重定向到回调地址,通过 URL 哈希参数携带相关信息。\n- `web_message`: 向父窗口发送 post message,适合通过 popup 方式实现外部身份源登录。\n- `form_post`: 用自动提交表单将客户端重定向到回调地址,表单中携带相关信息。\n ","schema":{"enum":["web_message","form_post","query","fragment"],"type":"string"}},{"name":"tenant_id","required":false,"in":"query","description":"租户 ID,如果设置之后,将会跳转到对应租户的登录页面。","schema":{"type":"string"}},{"name":"login_page_context","required":false,"in":"query","description":"额外的 `context` 参数,如果设置,在进行 `302` 跳转的时候,将会携带上此参数。","schema":{"type":"string"}},{"name":"ext_idp_conn_id","required":false,"in":"query","description":"外部身份源连接 ID。指定使用特定的外部身份源进行登录。","example":"62d00ccaf0xxxx0ad33f4a41","schema":{"type":"string"}},{"name":"deviceId","required":false,"in":"query","description":"用户登录设备的唯一标识,可选。","example":"xxxxx","schema":{"type":"string"}}],"responses":{"302":{"description":""}},"tags":["登录/API 列表"]}},"/api/v3/signin-by-extidp":{"get":{"operationId":"OidcV2SignOnController_signInByExtIdp","x-authing-hidden-from-sdk":true,"summary":"外部身份源(社会化)登录","description":"\n此端点会通过浏览器 `302` 跳转的方式先跳转到第三方的登录页面,终端用户在第三方系统认证完成之后,浏览器再会跳转到 Authing 服务器,Authing 服务器会将此外部身份源绑定到该用户身上。最终的结果会通过浏览器 Window Post Message 的方式传递给开发者。\n你可以在你的应用系统中放置一个按钮,引导用户点击之后,弹出一个 Window Popup,地址为此端点,当用户在第三方身份源认证完成之后,此 Popup 会通过 Window Post Message 的方式传递给父窗口。\n ","parameters":[{"name":"client_id","required":true,"in":"query","description":"Authing 应用 ID","example":"5c9b079883xxxxd55a101082","schema":{"type":"string"}},{"name":"ext_idp_conn_id","required":true,"in":"query","description":"外部身份源连接 ID。指定使用特定的外部身份源进行登录。","example":"62d00ccaf0xxxx0ad33f4a41","schema":{"type":"string"}},{"name":"response_type","required":true,"in":"query","description":"如果回调地址是后端服务地址,选择授权码模式,此项选 `code`;如果回调地址是前端 SPA 应用地址,选择隐式模式,此项填可选值为 `id_token`, `id_token token`。你可以在此了解[OIDC 相关规范](https://openid.net/specs/openid-connect-core-1_0.html#AuthorizationExamples)。\n- `code`: 授权码模式,回调时只返回 `code`,再根据 `code` 换取 `id_token` 和 `access_token`。\n- `id_token`: 回调时直接返回 `id_token`,适用于浏览器单页应用无后端服务交互的场景。\n- `id_token token`: 回调时直接返回 `id_token` 和 `access_token`,适用于浏览器单页应用无后端服务交互的场景。\n- `code id_token`: 回调时直接返回 `id_token` 和 `code`。\n- `code token`: 回调时直接返回 `access_token` 和 `code`。\n- `code id_token access_token`: 回调时直接返回 `id_token`、`access_token` 和 `code`。\n","example":"code","schema":{"enum":["none","code","token","id_token token","id_token","code token","code id_token token","code id_token"],"type":"string"}},{"name":"redirect_uri","required":true,"in":"query","description":"回调链接,用户在 OP 认证成功后,OP 会将授权码以 URL query 的形式发送到这个地址。这个值必须出现在控制台配置的回调地址中,否则 OP 不允许向该地址回调。","example":"https://you_domain.com/callback","schema":{"type":"string"}},{"name":"scope","required":true,"in":"query","description":"需要请求的权限,必须包含 openid。如果需要获取手机号和 email 需要包含 phone email;如果需要 refresh_token 需要包含 offline_access。多个 scope 请用空格分隔。id_token 解码后的内容中会包含这些 scope 对应的用户信息相关的字段。\n- `openid`: 必须包含。\n- `profile`: 返回 birthdate,family_name,gender,given_name,locale,middle_name,name,nickname,picture,preferred_username,profile,updated_at,website,zoneinfo 字段。\n- `username`: 返回 username。\n- `email`: 返回 email,email_verified。\n- `phone`: 返回 phone_number, phone_number_verified。\n- `offline_access`: 如果存在此参数,token 接口会返回 refresh_token 字段。\n- `roles`: 返回用户的角色列表。\n- `external_id`: 用户在原有系统的用户 ID。\n- `extended_fields`: 返回用户的扩展字段信息,内容为一个对象,key 为扩展字段名,value 为扩展字段值。\n- `tenant_id`: 返回用户的租户 ID。\n ","example":"openid profile","schema":{"type":"string"}},{"name":"state","required":true,"in":"query","description":"一个随机字符串,用于防范 CSRF 攻击,如果 response 中的 state 值和发送请求之前设置的 state 值不同,说明受到攻击。","example":"6223573295","schema":{"type":"string"}},{"name":"nonce","required":false,"in":"query","description":"一个随机字符串,用于防范 Replay 攻击,implicit 模式下必填。","example":"1831289","schema":{"type":"string"}},{"name":"prompt","required":false,"in":"query","description":"可以为 none,login,consent 或 select_account,指定 Authing 认证服务器与终端用户的交互方式。点此[参考OIDC 规范](https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest)","example":"none","schema":{"type":"string"}},{"name":"tenant_id","required":false,"in":"query","description":"租户 ID,如果设置之后,将会跳转到对应租户的登录页面。","schema":{"type":"string"}},{"name":"login_page_context","required":false,"in":"query","description":"额外的 `context` 参数,如果设置,在进行 `302` 跳转的时候,将会携带上此参数。","schema":{"type":"string"}}],"responses":{"302":{"description":""}},"tags":["登录/API 列表","多租户登录/外部身份源(社会化)登录"]}},"/interaction/oidc/{interactionKey}/login":{"post":{"operationId":"OidcV2SignOnController_auth","x-authing-hidden-from-sdk":true,"summary":"OIDC interaction","description":"OIDC interaction","parameters":[{"name":"interactionKey","required":true,"in":"path","schema":{"type":"string"}},{"name":"tenant_id","required":true,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FinishLoginParams"}}}},"responses":{"201":{"description":""}}}},"/interaction/oidc/{interactionKey}/end":{"post":{"operationId":"OidcV2SignOnController_finishLogin","x-authing-hidden-from-sdk":true,"summary":"OIDC interaction","description":"OIDC interaction","parameters":[{"name":"interactionKey","required":true,"in":"path","schema":{"type":"string"}},{"name":"tenant_id","required":true,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FinishLoginParams"}}}},"responses":{"201":{"description":""}}}},"/interaction/oidc/{interactionKey}/confirm":{"post":{"operationId":"OidcV2SignOnController_handleConfirmAuth","x-authing-hidden-from-sdk":true,"parameters":[{"name":"interactionKey","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}}}},"/interaction/oidc/{interactionKey}/abort":{"post":{"operationId":"OidcV2SignOnController_handleAbortAuth","x-authing-hidden-from-sdk":true,"parameters":[{"name":"interactionKey","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}}}},"/oidc/session/end":{"get":{"operationId":"OidcV2LogoutController_frontChannelLogout","x-authing-hidden-from-sdk":true,"summary":"前端登出","description":"此端点用于用户在浏览器端主动登出,且此接口只应该在浏览器端访问。当用户在浏览器端访问这个地址之后,Authing 服务器会清除用户的登录态,\n 如果设置了登出后的回调地址(`post_logout_redirect_uri`),用户登出之后浏览器 `302` 跳转到该地址,否则将会渲染一个提示用于已经登出的页面。\n ","parameters":[{"name":"id_token_hint","required":false,"in":"query","description":"用户的 `id_token`,当设置了 `post_logout_redirect_uri` 时此参数必填。`id_token` 作为用户访问此端点的请求凭证,防止出现第三方放置恶意登出地址的情况诱导用户点击的情况。","example":"xxxxxxxxx","schema":{"type":"string"}},{"name":"post_logout_redirect_uri","required":false,"in":"query","description":"登出后的回调地址,此地址必须要在应用配置中的**登出回调 URL**中进行配置。设置此参数时必须同时传递 `id_token_hint`。","example":"https://example.com/homepage","schema":{"type":"string"}},{"name":"state","required":false,"in":"query","description":"自定义中间状态,为任意随机字符串,用户登出之后回调到你配置的回调地址时,会同时携带此 state。","example":"","schema":{"type":"string"}}],"responses":{"302":{"description":""}},"tags":["登出/API 列表"]}},"/oidc/token":{"post":{"operationId":"OidcV2TokenController_exchangeToken","x-authing-hidden-from-sdk":true,"summary":"获取 Token","description":"\n\n此端点用于获取用户的 `id_token` 和 `access_token`。**请注意此端点要求的请求 Content-Type 为 application/x-www-form-urlencoded。**\n\n取决于你使用的 OIDC 授权模式,你可能需要使用不同的方式获取 `id_token` 和 `access_token`,如果是**隐式模式**这类直接返回 `id_token` 和 `access_token` 的端点,\n不需要再次调用此接口。不同授权模式的流程介绍请见上文。\n\n### 换取 token 身份验证方式\n\n针对不同场景,换取 token 时需要提供不同的身份验证方式,防止非法伪造请求:\n\n- `client_secret_post`: 在请求体 Body 中传递应用密钥 `client_secret`。\n- `client_secret_basic`: 在 `authorization` 请求头中传递 `Basic encodedString`,其中 `encodedString` 是\n`client_id:client_secret` 的 Base64 编码值。\n- `none`: 不需要提供认证方式,一般适用于直接在前端单页应用这类无法安全存储应用密钥 `client_secret` 的场景。\n\n### 不同授权模式获取 Token 的示例\n\n下面是不同模式下获取 `id_token` 和 `access_token` 的示例(以 `client_secret_post` 方式为例)。\n\n#### 授权码模式\n\n```\ncurl --request POST 'https://<你的应用域名>.authing.cn/oidc/token' \\\n --header 'Content-Type: application/x-www-form-urlencoded' \\\n --data client_id=xxxx \\\n --data client_secret=xxxx \\\n --data grant_type=authorization_code \\\n --data redirect_uri=https://baidu.com' \\\n --data code=NBS4GK4rZli1jtWcVy7yqd8AT3PxyENhu8XbT3oBMko\n```\n\n#### 授权码 + PKCE 模式\n\n```\ncurl --request POST \\\n --url https://<你的应用域名>.authing.cn/oidc/token \\\n --header 'Content-Type: application/x-www-form-urlencoded' \\\n --data client_id=xxxx \\\n --data client_secret=xxxx \\\n --data grant_type=authorization_code \\\n --data redirect_uri=https://baidu.com \\\n --data code=NBS4GK4rZli1jtWcVy7yqd8AT3PxyENhu8XbT3oBMko \\\n --data code_verifier=dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk\n```\n\n#### Client Credentials 模式\n\n```\ncurl --request POST \\\n --url https://<你的应用域名>.authing.cn/oidc/token \\\n --header 'Content-Type: application/x-www-form-urlencoded' \\\n --data client_id=xxxx \\\n --data client_secret=xxxx \\\n --data grant_type=client_credentials \\\n --data scope=announce:read announce:update revenue:read customer user-growth:read\n```\n\n ","parameters":[],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/TokenEndPointParams"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginTokenResponseDataDto"}}}}},"tags":["管理 Token/API 列表"]}},"/oidc/token/introspection":{"post":{"operationId":"OidcV2TokenController_introspectToken","x-authing-hidden-from-sdk":true,"summary":"验证 Token","description":"\n\n验证 Token 分为两种模式:本地使用应用密钥验证与使用 Authing 在线验证。我们建议在本地验证 JWT Token,因为可以节省你的服务器带宽并加快验证速度。你也可以选择将 Token 发送到 Authing 的验证接口由 Authing 进行验证并返回结果,但这样会造成网络延迟,而且在网络拥塞时可能会有慢速请求。\n\n此端点用于在线检查 `access_token` 或者 `refresh_token` 的状态。`id_token` 不提供在线检验接口,请使用本地认证方法。**请注意此端点要求的请求 Content-Type 为 application/x-www-form-urlencoded。**\n\n下面提供两种在本地验证 `id_token` 或者 `access_token` 的方法。\n\n#### 使用应用密钥验证 HS256 算法签名的 Token\n\n默认情况下,Authing `id_token` 和 `access_token` 的加密方式为 HS256。下面以 `Node.js` 为例,其他语言同理:\n\n```javascript\nconst jwt = require('jsonwebtoken');\ntry {\n let decoded = jwt.verify('IdToken 或者 AccessToken', 'your_secret'),\n expired = Date.parse(new Date()) / 1000 > decoded.exp;\n if (expired) {\n // 过期\n } else {\n // 合法也没过期,正常放行\n }\n} catch (error) {\n // 不合法\n}\n```\n\n#### 使用应用公钥验证 RS256 算法签名的 IdToken\n\n如果使用 RS256 签名算法,需要使用公钥验证签名。Authing 将使用应用的私钥进行签名,请使用 https://<应用域名>.authing.cn/oidc/.well-known/jwks.json 中的公钥来验证签名。Authing 颁发的 `access_token` 和 `id_token` 都可以使用上述公钥进行验签。\n\n如果你使用 javascript,可以使用 jose 库来验证 RS256 签名:\n\n> 请使用 v2.x.x 或以下版本的 jose 库,新版 jose 库和本代码示例不兼容。\n\n```javascript\nconst jose = require('jose');\n// 下面的参数内容为 https://<应用域名>.authing.cn/oidc/.well-known/jwks.json 返回的结果\nconst keystore = jose.JWKS.asKeyStore({\n keys: [\n {\n e: 'AQAB',\n n:\n 'o8iCY52uBPOCnBSRCr3YtlZ0UTuQQ4NCeVMzV7JBtH-7Vuv0hwGJTb_hG-BeYOPz8i6YG_o367smV2r2mnXbC1cz_tBfHD4hA5vnJ1eCpKRWX-l6fYuS0UMti-Bmg0Su2IZxXF9T1Cu-AOlpgXFC1LlPABL4E0haHO8OwQ6QyEfiUIs0byAdf5zeEHFHseVHLjsM2pzWOvh5e_xt9NOJY4vB6iLtD5EIak04i1ND_O0Lz0OYbuV0KjluxaxoiexJ8kGo9W1SNza_2TqUAR6hsPkeOwwh-oHnNwZg8OEnwXFmNg-bW4KiBrQEG4yUVdFGENW6vAQaRa2bJX7obn4xCw',\n kty: 'RSA',\n alg: 'RS256',\n use: 'sig',\n kid: 'TfLOt3Lbn8_a8pRMuessamqj-o3DBCs1-owHLQ-VMqQ',\n },\n ],\n});\n// 选项中 issuer 的内容是 https://<应用域名>.authing.cn/oidc,audience 的内容是 应用 ID\n// id_token 很长,请向右滑动 ->\nconst res = jose.JWT.IdToken.verify(\n 'YOUR_ID_TOKEN',\n keystore,\n {\n issuer: 'https://example.authing.cn/oidc',\n audience: '5f17a529f64fb009b794a2ff',\n }\n);\nconsole.log(res);\n```\n\n\n ","parameters":[],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/TokenIntrospectEndpointParams"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenIntrospectResponse"}}}}},"tags":["管理 Token/API 列表"]}},"/oidc/token/revocation":{"post":{"operationId":"OidcV2TokenController_revokeToken","x-authing-hidden-from-sdk":true,"summary":"撤销 Token","description":"此端点用于撤销一个 `access_token` 或 `refresh_token`,可用于后端/移动端的登出场景。","parameters":[],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/TokenRevocationEndpointParams"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IsSuccessRespDto"}}}}},"tags":["管理 Token/API 列表"]}},"/mfa/token/introspection":{"post":{"operationId":"OidcV2TokenController_verifyMfaToken","summary":"验证 MFA Token","description":"验证 MFA Token","parameters":[],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/MfaTokenIntrospectEndpointParams"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaTokenIntrospectResponse"}}}}},"tags":["管理 Token/API 列表"]}},"/oidc/me":{"get":{"operationId":"OidcV2UserInfoController_oidcUserInfoGet","x-authing-hidden-from-sdk":true,"summary":"OIDC 获取用户信息接口","description":"OIDC 获取用户信息接口","parameters":[],"responses":{"200":{"description":""}},"tags":["OIDC 标准协议"]},"post":{"operationId":"OidcV2UserInfoController_oidcUserInfoPost","x-authing-hidden-from-sdk":true,"summary":"OIDC 获取用户信息接口(POST)","description":"OIDC 获取用户信息接口(POST)","parameters":[],"responses":{"200":{"description":""}},"tags":["OIDC 标准协议"]}},"/oidc/.well-known/openid-configuration":{"get":{"operationId":"OidcV2MetadataController_openIdConfiguration","x-authing-hidden-from-sdk":true,"summary":"OIDC 服务发现接口","description":"此端点为服务发现接口,包含了此 OIDC IDP 的相关信息。详情请见 OIDC 规范:https://openid.net/specs/openid-connect-discovery-1_0.html","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OidcDiscoveryMetadata"}}}}},"tags":["OIDC 标准协议"]}},"/oidc/.well-known/jwks.json":{"get":{"operationId":"OidcV2MetadataController_jwks","x-authing-hidden-from-sdk":true,"summary":"OIDC JWKs 接口","description":"OIDC JWKs 接口","parameters":[],"responses":{"200":{"description":""}},"tags":["OIDC 标准协议"]}},"/api/v2/oidc/validate_token":{"get":{"operationId":"OidcV2LegacyController_validateToken","x-authing-hidden-from-sdk":true,"summary":"旧版 token 验证接口","description":"旧版 token 验证接口","deprecated":true,"parameters":[],"responses":{"200":{"description":""}}}},"/api/v2/oidc/validate_pem_key":{"post":{"operationId":"OidcV2LegacyController_validatePEMKey","x-authing-hidden-from-sdk":true,"summary":"『ID Token 加密』的密钥格式校验接口,只有控制台在用","description":"『ID Token 加密』的密钥格式校验接口,只有控制台在用","deprecated":true,"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidatePEMKeyDto"}}}},"responses":{"201":{"description":""}}}},"/api/v3/signup":{"post":{"operationId":"SignUpV3Controller_signUp","summary":"注册","description":"\n此端点目前支持以下几种基于的注册方式:\n\n1. 基于密码(PASSWORD):用户名 + 密码,邮箱 + 密码。\n2. 基于一次性临时验证码(PASSCODE):手机号 + 验证码,邮箱 + 验证码。你需要先调用发送短信或者发送邮件接口获取验证码。\n\n社会化登录等使用外部身份源“注册”请直接使用**登录**接口,我们会在其第一次登录的时候为其创建一个新账号。\n","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignUpDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSingleRespDto"}}}}},"security":[{"x-authing-app-tenant-id":[]},{"x-authing-app-id":[]}],"tags":["注册/API 列表","多租户注册/API 列表"],"x-authing-code-samples":{"go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t reqDto := &dto.SignUpDto{\n\t\tConnection: \"PASSWORD\",\n\t\tPasswordPayload: dto.SignUpByPasswordDto{\n\t\t\tPassword: \"test\",\n\t\t\tUsername: \"test\",\n\t\t},\n\t}\n\trespDto := client.SignUp(reqDto)\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.SignUpByPasswordDto;\nimport cn.authing.sdk.java.dto.SignUpDto;\nimport cn.authing.sdk.java.dto.UserSingleRespDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class SignUpTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n SignUpDto reqDto = new SignUpDto();\n reqDto.setConnection(SignUpDto.Connection.PASSWORD);\n SignUpByPasswordDto passwordDto = new SignUpByPasswordDto();\n passwordDto.setPassword(\"123\");\n passwordDto.setEmail(\"123@qq.com\");\n reqDto.setPasswordPayload(passwordDto);\n UserSingleRespDto response = client.signUp(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n const result = await authenticationClient.signUp({\n connection: Models.SignUpDto.connection.PASSWORD,\n passwordPayload: {\n password: 'passw0rd',\n email: 'test-user@example.com'\n },\n profile: {\n nickname: '',\n company: 'Authing .Inc',\n photo: 'https://authing.cn/demo.jpg',\n device: 'iOS',\n browser: 'Edge',\n name: 'Mike',\n givenName: 'Zhou',\n familyName: 'Jay',\n middleName: 'Jane',\n profile: 'this is my profile',\n preferredUsername: 'Mike',\n website: 'https://authing.cn',\n birthdate: '2020.2.2',\n zoneinfo: 'HongKong',\n locale: 'EN-US',\n address: 'Hai Dian XX',\n formatted: '',\n streetAddress: 'Hai Dian Street 1',\n locality: 'BeiJing HaiDian',\n region: 'china',\n postalCode: '3500000',\n country: 'china',\n customData: {\n name: 'H'\n }\n }\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n$data = $authenticationClient->signUp(\n array(\n \"connection\" => \"PASSWORD\",\n \"passwordPayload\" => array(\n \"username\" => \"test\",\n \"password\" => \"passw0rd\"\n )\n )\n);\nprint_r($data);\n"}}},"/api/v3/send-enroll-factor-request":{"post":{"operationId":"FactorsV3Controller_sendEnrollFactorRequest","summary":"发起绑定 MFA 认证要素请求","description":"当用户未绑定某个 MFA 认证要素时,可以发起绑定 MFA 认证要素请求。不同类型的 MFA 认证要素绑定请求需要发送不同的参数,详细见 profile 参数。发起验证请求之后,Authing 服务器会根据相应的认证要素类型和传递的参数,使用不同的手段要求验证。此接口会返回 enrollmentToken,你需要在请求「绑定 MFA 认证要素」接口时带上此 enrollmentToken,并提供相应的凭证。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEnrollFactorRequestDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEnrollFactorRequestRespDto"}}}}},"security":[{"bearer":[]}],"tags":["MFA 要素管理/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\nusing Newtonsoft.Json.Linq;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var res = await authenticationClient.SendEnrollFactorRequest(new SendEnrollFactorRequestDto()\r\n {\r\n FactorType = SendEnrollFactorRequestDto.factorType.SMS,\r\n Profile = new FactorProfile()\r\n {\r\n PhoneNumber = \"AUTHING_PHONE\",\r\n }\r\n });\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n reqDto := &dto.SendEnrollFactorRequestDto{\n\t\tProfile: dto.FactorProfile{\n\t\t\tPhoneNumber: \"188xxxx8888\",\n\t\t},\n\t\tFactorType: \"SMS\",\n\t}\n\trespDto := client.SendEnrollFactorRequest(reqDto)\n\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.FactorProfile;\nimport cn.authing.sdk.java.dto.SendEnrollFactorRequestDto;\nimport cn.authing.sdk.java.dto.SendEnrollFactorRequestRespDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class SendEnrollFactorRequestTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n SendEnrollFactorRequestDto reqDto = new SendEnrollFactorRequestDto();\n reqDto.setFactorType(SendEnrollFactorRequestDto.FactorType.EMAIL);\n FactorProfile profile = new FactorProfile();\n profile.setEmail(\"123@qq.com\");\n reqDto.setProfile(profile);\n SendEnrollFactorRequestRespDto response = client.sendEnrollFactorRequest(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.sendEnrollFactorRequest({\n factorType: Models.SendEnrollFactorRequestDto.factorType.SMS,\n profile: {\n phoneNumber: '188xxxx8888',\n phoneCountryCode: '+86',\n email: 'test@example.com'\n }\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"ACCESS_TOKEN\");\n\n$data = $authenticationClient->sendEnrollFactorRequest(array(\n \"factorType\" => \"SMS\",\n \"profile\" => array(\n \"phoneNumber\" => \"188xxxx8888\"\n )\n));\nprint_r($data);\n"}}},"/api/v3/enroll-factor":{"post":{"operationId":"FactorsV3Controller_enrollFactor","summary":"绑定 MFA 认证要素","description":"绑定 MFA 要素。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollFactorDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollFactorRespDto"}}}}},"security":[{"bearer":[]}],"tags":["MFA 要素管理/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\nusing Newtonsoft.Json.Linq;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var res = await authenticationClient.SendEnrollFactorRequest(new SendEnrollFactorRequestDto()\r\n {\r\n FactorType = SendEnrollFactorRequestDto.factorType.EMAIL,\r\n Profile = new FactorProfile()\r\n {\r\n Email = \"AUTHING_EMAIL\",\r\n }\r\n });\r\n\r\n EnrollFactorDto param = new EnrollFactorDto\r\n {\r\n EnrollmentToken = res.Data.EnrollmentToken,\r\n FactorType = EnrollFactorDto.factorType.EMAIL,\r\n EnrollmentData = new EnrollFactorEnrollmentDataDto()\r\n {\r\n PassCode = \"AUTHING_CODE\"\r\n }\r\n };\r\n var result = await authenticationClient.EnrollFactor(param);\r\n\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n print_r($data);\n reqDto := &dto.EnrollFactorDto{\n EnrollmentData: dto.EnrollFactorEnrollmentDataDto{PassCode: \"1234\"},\n // 需要替换成 sendEnrollFactorRequest 接口返回的真实 EnrollmentToken\n EnrollmentToken: \"xxxx\",\n FactorType: \"SMS\",\n }\n respDto := client.EnrollFactor(reqDto)\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.EnrollFactorDto;\nimport cn.authing.sdk.java.dto.EnrollFactorEnrollmentDataDto;\nimport cn.authing.sdk.java.dto.EnrollFactorRespDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class EnrollFactorTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n EnrollFactorDto reqDto = new EnrollFactorDto();\n reqDto.setFactorType(EnrollFactorDto.FactorType.EMAIL);\n // 「发起绑定 MFA 认证要素请求」接口返回的 enrollmentToken,此 token 有效时间为一分钟。\n reqDto.setEnrollmentToken(\"xxx\");\n EnrollFactorEnrollmentDataDto dataDto = new EnrollFactorEnrollmentDataDto();\n dataDto.setPassCode(\"123\");\n reqDto.setEnrollmentData(dataDto);\n EnrollFactorRespDto response = client.enrollFactor(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.enrollFactor({\n factorType: Models.EnrollFactorDto.factorType.SMS,\n enrollmentToken:\n 'TQoCISidM0kBji0dxRi3afSDtkvvMiUphenIgLF87y+JOw4T8fDWOsHHXIcvZ2EVESXhTrfGyh1iGf52Cg9e9byeFQvm1VZ0QWrwmzwpntFAVtf1IP9LqVhmzXhBMFvLOcU/z1Eh/n0CrwX0uHNpJoMW9lp9AqHd9HvauaGKX+Y=',\n enrollmentData: {\n passCode: '123456'\n }\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"ACCESS_TOKEN\");\n\n$data = $authenticationClient->enrollFactor(array(\n \"factorType\" => \"SMS\",\n // 需要替换成 sendEnrollFactorRequest 接口返回的真实 enrollmentToken\n \"enrollmentToken\" => \"xxxxxx\",\n \"enrollmentData\" => array(\n \"passCode\" => \"1234\"\n )\n));\nprint_r($data);\n"}}},"/api/v3/reset-factor":{"post":{"operationId":"FactorsV3Controller_resetFactor","summary":"解绑 MFA 认证要素","description":"根据 Factor ID 解绑用户绑定的某个 MFA 认证要素。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetFactorDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetFactorRespDto"}}}}},"security":[{"bearer":[]}],"tags":["MFA 要素管理/API 列表"],"x-authing-code-samples":{"csharp":"using System.Linq;\r\nusing System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\nusing Newtonsoft.Json.Linq;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var lists = await authenticationClient.ListEnrolledFactors();\r\n var target = lists.Data.FirstOrDefault(i => i.FactorId.Contains(\"email\"));\r\n var res = await authenticationClient.ResetFactor(new ResetFactorDto { FactorId = target.FactorId });\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n // 需要替换成真实的 factorId\n\treqDto := &dto.ResetFactorDto{FactorId: \"xxxx\"}\n\trespDto := client.ResetFactor(reqDto)\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.ResetFactorRespDto;\nimport cn.authing.sdk.java.dto.RestFactorDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class ResetFactorTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n RestFactorDto reqDto = new RestFactorDto();\n reqDto.setFactorId(\"6229ffaxxxxxxxxcade3e3d9\");\n ResetFactorRespDto response = client.resetFactor(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n const result = await authenticationClient.resetFactor({\n factorId: '6229ffaxxxxxxxxcade3e3d9'\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"ACCESS_TOKEN\");\n\n$data = $authenticationClient->resetFactor(array(\n // 需要替换成真实的 factorId\n \"factorId\" => \"xxxxxx\",\n));\nprint_r($data);\n"}}},"/api/v3/list-enrolled-factors":{"get":{"operationId":"FactorsV3Controller_listEnrolledFactors","summary":"获取绑定的所有 MFA 认证要素","description":"Authing 目前支持四种类型的 MFA 认证要素:手机短信、邮件验证码、OTP、人脸。","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListEnrolledFactorsRespDto"}}}}},"security":[{"bearer":[]}],"tags":["MFA 要素管理/API 列表"],"x-authing-code-samples":{"csharp":"using System.Linq;\r\nusing System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var lists = await authenticationClient.ListEnrolledFactors();\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n respDto := client.ListEnrolledFactors()\n\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.ListEnrolledFactorsRespDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class ListEnrolledFactorsTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n ListEnrolledFactorsRespDto response = client.listEnrolledFactors();\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.listEnrolledFactors();\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"ACCESS_TOKEN\");\n\n$data = $authenticationClient->listEnrolledFactors();\nprint_r($data);\n"}}},"/api/v3/get-factor":{"get":{"operationId":"FactorsV3Controller_getFactor","summary":"获取绑定的某个 MFA 认证要素","description":"根据 Factor ID 获取用户绑定的某个 MFA Factor 详情。","parameters":[{"name":"factorId","required":true,"in":"query","description":"MFA Factor ID","example":"6229ffaxxxxxxxxcade3e3d9","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetFactorRespDto"}}}}},"security":[{"bearer":[]}],"tags":["MFA 要素管理/API 列表"],"x-authing-code-samples":{"csharp":"using System.Linq;\r\nusing System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var lists = await authenticationClient.ListEnrolledFactors();\r\n var res = await authenticationClient.GetFactor(lists.Data.First().FactorId);\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n // 需要替换成真实的 factorId\n reqDto := &dto.GetFactorDto{FactorId: \"xxxx\"}\n respDto := client.GetFactor(reqDto)\n\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.GetFactorDto;\nimport cn.authing.sdk.java.dto.GetFactorRespDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class GetFactorTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n GetFactorDto reqDto = new GetFactorDto();\n reqDto.setFactorId(\"6229ffaxxxxxxxxcade3e3d9\");\n GetFactorRespDto response = client.getFactor(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.getFactor({\n factorId: '635391f4xxxxxx6bba26ed4|email'\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"ACCESS_TOKEN\");\n\n$data = $authenticationClient->getFactor(array(\n // 需要替换成真实的 factorId\n \"factorId\" => \"xxxxxx\"\n));\nprint_r($data);\n"}}},"/api/v3/list-factors-to-enroll":{"get":{"operationId":"FactorsV3Controller_listFactorsToEnroll","summary":"获取可绑定的 MFA 认证要素","description":"获取所有应用已经开启、用户暂未绑定的 MFA 认证要素,用户可以从返回的列表中绑定新的 MFA 认证要素。","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListFactorsToEnrollRespDto"}}}}},"security":[{"bearer":[]}],"tags":["MFA 要素管理/API 列表"],"x-authing-code-samples":{"csharp":"using System.Linq;\r\nusing System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var lists = await authenticationClient.ListFactorsToEnroll();\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n respDto := client.ListFactorsToEnroll()\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.ListFactorsToEnrollRespDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class ListFactorsToEnrollTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n ListFactorsToEnrollRespDto response = client.listFactorsToEnroll();\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.listFactorsToEnroll();\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"ACCESS_TOKEN\");\n\n$data = $authenticationClient->listFactorsToEnroll();\nprint_r($data);\n"}}},"/api/v3/mfa-totp-verify":{"post":{"operationId":"FactorsV3Controller_mfaOtpVerify","summary":"校验用户 MFA 绑定的 OTP","description":"校验用户 MFA 绑定的 OTP。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaOtpVerityDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaOtpVerityRespDto"}}}}},"security":[{"bearer":[]}],"tags":["MFA 要素管理/API 列表"]}},"/api/v3/link-extidp":{"get":{"operationId":"ExtIdpAuthenticationV3Controller_linkExtIdp","x-authing-hidden-from-sdk":true,"summary":"绑定外部身份源","description":"\n由于绝大多数的外部身份源登录不允许在第三方系统直接输入账号密码进行登录,所以外部身份源的绑定总是需要先跳转到对方的登录页面进行认证。此端点会通过浏览器 `302` 跳转的方式先跳转到第三方的登录页面,\n终端用户在第三方系统认证完成之后,浏览器再会跳转到 Authing 服务器,Authing 服务器会将此外部身份源绑定到该用户身上。最终的结果会通过浏览器 Window Post Message 的方式传递给开发者。\n你可以在你的应用系统中放置一个按钮,引导用户点击之后,弹出一个 Window Popup,地址为此端点,当用户在第三方身份源认证完成之后,此 Popup 会通过 Window Post Message 的方式传递给父窗口。\n ","parameters":[{"name":"ext_idp_conn_identifier","required":true,"in":"query","description":"外部身份源连接唯一标志","example":"my-wechat","schema":{"type":"string"}},{"name":"app_id","required":true,"in":"query","description":"Authing 应用 ID","example":"","schema":{"type":"string"}},{"name":"id_token","required":true,"in":"query","description":"用户的 id_token","example":"","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateBindExtIdpLinkRespDto"}}}},"302":{"description":""}},"security":[{"bearer":[]}],"tags":["账号绑定/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\nusing Newtonsoft.Json.Linq;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var res = await authenticationClient.LinkExtIdp(\"AUTHING_EXT_IDP_CONNIDENTIFIER\", \"AUTHING_APPID\", loginTokenRespDto.Data.Id_token);\r\n }\r\n }\r\n}"}}},"/api/v3/generate-link-extidp-url":{"get":{"operationId":"ExtIdpAuthenticationV3Controller_generateLinkExtIdpUrl","summary":"生成绑定外部身份源的链接","description":"\n此接口用于生成绑定外部身份源的链接,生成之后可以引导用户进行跳转。\n ","parameters":[{"name":"ext_idp_conn_identifier","required":true,"in":"query","description":"外部身份源连接唯一标志","example":"my-wechat","schema":{"type":"string"}},{"name":"app_id","required":true,"in":"query","description":"Authing 应用 ID","example":"","schema":{"type":"string"}},{"name":"id_token","required":true,"in":"query","description":"用户的 id_token","example":"","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateBindExtIdpLinkRespDto"}}}}},"security":[{"bearer":[]}],"tags":["账号绑定/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\nusing Newtonsoft.Json.Linq;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var res = await authenticationClient.GenerateLinkExtIdpUrl(\"AUTHING_EXT_IDP_CONNIDENTIFIER\", \"AUTHING_APPID\", loginTokenRespDto.Data.Id_token);\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t reqDto := &dto.GenerateLinkExtidpUrlDto{\n\t\tExtIdpConnIdentifier: \"xxxx\",\n\t\tAppId: \"xxxx\",\n // 需要替换为用户真实的 id_token\n\t\tIdToken: \"xxxx\",\n\t}\n\trespDto := client.GenerateLinkExtIdpUrl(reqDto)\n\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.GenerateBindExtIdpLinkRespDto;\nimport cn.authing.sdk.java.dto.GenerateLinkExtidpUrlDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class GenerateLinkExtIdpUrlTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n GenerateLinkExtidpUrlDto reqDto = new GenerateLinkExtidpUrlDto();\n reqDto.setAppId(APP_ID);\n reqDto.setIdToken(\"xxx\");\n reqDto.setExtIdpConnIdentifier(\"my-wechat\");\n GenerateBindExtIdpLinkRespDto response = client.generateLinkExtIdpUrl(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n$data = $authenticationClient->generateLinkExtIdpUrl(array(\n \"ext_idp_conn_identifier\" => \"xxxxxxxx\",\n \"app_id\" => \"xxxxxx\",\n // 需要替换为用户真实的 id_token\n \"id_token\" => \"xxxxxx\"\n));\nprint_r($data);\n"}}},"/api/v3/unlink-extidp":{"post":{"operationId":"ExtIdpAuthenticationV3Controller_unlinkExtIdp","summary":"解绑外部身份源","description":"解绑外部身份源,此接口需要传递用户绑定的外部身份源 ID,**注意不是身份源连接 ID**。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnlinkExtIdpDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommonResponseDto"}}}}},"security":[{"bearer":[]}],"tags":["账号绑定/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\nusing Newtonsoft.Json.Linq;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var res = await authenticationClient.UnbindExtIdp(\r\n new UnbindExtIdpDto()\r\n {\r\n ExtIdpId = \"AUTHING_EXT_IDP_ID\"\r\n });\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n reqDto := &dto.UnlinkExtIdpDto{}\n\trespDto := client.UnlinkExtIdp(reqDto)\n\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.CommonResponseDto;\nimport cn.authing.sdk.java.dto.UnbindExtIdpDto;\nimport cn.authing.sdk.java.dto.UnlinkExtIdpDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class UnbindExtIdpTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n UnlinkExtIdpDto reqDto = new UnlinkExtIdpDto();\n // 此接口需要传递用户绑定的外部身份源 ID, 注意不是身份源连接 ID。\n reqDto.setExtIdpId(\"62f209327xxxxcc10d966ee5\");\n CommonResponseDto response = client.unlinkExtIdp(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"ACCESS_TOKEN\");\n\n$data = $authenticationClient->unbindExtIdp(array(\n \"extIdpId\" => \"xxxxxxxx\"\n));\nprint_r($data);\n"}}},"/api/v3/get-identities":{"get":{"operationId":"ExtIdpAuthenticationV3Controller_getIdentities","summary":"获取绑定的外部身份源","description":"\n如在**介绍**部分中所描述的,一个外部身份源对应多个外部身份源连接,用户通过某个外部身份源连接绑定了某个外部身份源账号之后,\n用户会建立一条与此外部身份源之间的关联关系。此接口用于获取此用户绑定的所有外部身份源。\n\n取决于外部身份源的具体实现,一个用户在外部身份源中,可能会有多个身份 ID,比如在微信体系中会有 `openid` 和 `unionid`,在非书中有\n`open_id`、`union_id` 和 `user_id`。在 Authing 中,我们把这样的一条 `open_id` 或者 `unionid_` 叫做一条 `Identity`, 所以用户在一个身份源会有多条 `Identity` 记录。\n\n以微信为例,如果用户使用微信登录或者绑定了微信账号,他的 `Identity` 信息如下所示:\n\n```json\n[\n {\n \"identityId\": \"62f20932xxxxbcc10d966ee5\",\n \"extIdpId\": \"62f209327xxxxcc10d966ee5\",\n \"provider\": \"wechat\",\n \"type\": \"openid\",\n \"userIdInIdp\": \"oH_5k5SflrwjGvk7wqpoBKq_cc6M\",\n \"originConnIds\": [\"62f2093244fa5cb19ff21ed3\"]\n },\n {\n \"identityId\": \"62f726239xxxxe3285d21c93\",\n \"extIdpId\": \"62f209327xxxxcc10d966ee5\",\n \"provider\": \"wechat\",\n \"type\": \"unionid\",\n \"userIdInIdp\": \"o9Nka5ibU-lUGQaeAHqu0nOZyJg0\",\n \"originConnIds\": [\"62f2093244fa5cb19ff21ed3\"]\n }\n]\n```\n\n\n可以看到他们的 `extIdpId` 是一样的,这个是你在 Authing 中创建的**身份源 ID**;`provider` 都是 `wechat`;\n通过 `type` 可以区分出哪个是 `openid`,哪个是 `unionid`,以及具体的值(`userIdInIdp`);他们都来自于同一个身份源连接(`originConnIds`)。\n\n\n ","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetIdentitiesRespDto"}}}}},"security":[{"bearer":[]}],"tags":["账号绑定/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\nusing Newtonsoft.Json.Linq;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var res = await authenticationClient.GetIdentities();\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n respDto := client.GetIdentities()\n\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.GetIdentitiesRespDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class GetIdentitiesTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n GetIdentitiesRespDto response = client.getIdentities();\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"ACCESS_TOKEN\");\n\n$data = $authenticationClient->getIdentities();\nprint_r($data);\n"}}},"/api/v3/get-application-enabled-extidps":{"get":{"operationId":"ExtIdpAuthenticationV3Controller_getApplicationEnabledExtIdps","summary":"获取应用开启的外部身份源列表","description":"获取应用开启的外部身份源列表,前端可以基于此渲染外部身份源按钮。","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetExtIdpsRespDto"}}}}},"security":[{"bearer":[]}],"tags":["账号绑定/API 列表"],"x-authing-code-samples":{"go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t respDto := client.GetApplicationEnabledExtIdps()\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.GetExtIdpsRespDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class GetApplicationEnabledExtIdpsTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n GetExtIdpsRespDto response = client.getApplicationEnabledExtIdps();\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n$data = $authenticationClient->getApplicationEnabledExtIdps();\nprint_r($data);\n"}}},"/api/v3/signin":{"post":{"operationId":"SignInV3Controller_signInByCredentials","x-authing-signin-api":true,"summary":"使用用户凭证登录","description":"\n此端点为基于直接 API 调用形式的登录端点,适用于你需要自建登录页面的场景。**此端点暂时不支持 MFA、信息补全、首次密码重置等流程,如有需要,请使用 OIDC 标准协议认证端点。**\n\n\n注意事项:取决于你在 Authing 创建应用时选择的**应用类型**和应用配置的**换取 token 身份验证方式**,在调用此接口时需要对客户端的身份进行不同形式的验证。\n\n<details>\n<summary>点击展开详情</summary>\n\n<br>\n\n你可以在 [Authing 控制台](https://console.authing.cn) 的**应用** - **自建应用** - **应用详情** - **应用配置** - **其他设置** - **授权配置**\n中找到**换取 token 身份验证方式** 配置项:\n\n> 单页 Web 应用和客户端应用隐藏,默认为 `none`,不允许修改;后端应用和标准 Web 应用可以修改此配置项。\n\n![](https://files.authing.co/api-explorer/tokenAuthMethod.jpg)\n\n#### 换取 token 身份验证方式为 none 时\n\n调用此接口不需要进行额外操作。\n\n#### 换取 token 身份验证方式为 client_secret_post 时\n\n调用此接口时必须在 body 中传递 `client_id` 和 `client_secret` 参数,作为验证客户端身份的条件。其中 `client_id` 为应用 ID、`client_secret` 为应用密钥。\n\n#### 换取 token 身份验证方式为 client_secret_basic 时\n\n调用此接口时必须在 HTTP 请求头中携带 `authorization` 请求头,作为验证客户端身份的条件。`authorization` 请求头的格式如下(其中 `client_id` 为应用 ID、`client_secret` 为应用密钥。):\n\n```\nBasic base64(<client_id>:<client_secret>)\n```\n\n结果示例:\n\n```\nBasic NjA2M2ZiMmYzY3h4eHg2ZGY1NWYzOWViOjJmZTdjODdhODFmODY3eHh4eDAzMjRkZjEyZGFlZGM3\n```\n\nJS 代码示例:\n\n```js\n'Basic ' + Buffer.from(client_id + ':' + client_secret).toString('base64');\n```\n\n</details>\n\n ","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SigninByCredentialsDto"}}}},"responses":{"200":{"description":"成功认证","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginTokenRespDto"}}}}},"security":[{"x-authing-app-id":[]}],"tags":["登录/API 列表","多租户登录/使用用户凭证登录"],"x-authing-code-samples":{"go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\treqDto := &dto.SigninByCredentialsDto{\n Connection: \"PASSWORD\",\n PasswordPayload: dto.SignInByPasswordPayloadDto{\n Password: \"demo\",\n Username: \"demo\",\n },\n ClientId: \"AUTHING_APP_ID\",\n ClientSecret: \"AUTHING_APP_SECRET\",\n}\nrespDto := client.SignInByCredentials(reqDto)\n\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.LoginTokenRespDto;\nimport cn.authing.sdk.java.dto.SignInByPasswordPayloadDto;\nimport cn.authing.sdk.java.dto.SigninByCredentialsDto;\nimport cn.authing.sdk.java.enums.AuthMethodEnum;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class SignInByCredentialsTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setTokenEndPointAuthMethod(AuthMethodEnum.CLIENT_SECRET_BASIC.getValue());\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n SigninByCredentialsDto reqDto = new SigninByCredentialsDto();\n reqDto.setConnection(SigninByCredentialsDto.Connection.PASSWORD);\n SignInByPasswordPayloadDto passwordPayloadDto = new SignInByPasswordPayloadDto();\n passwordPayloadDto.setPassword(\"123\");\n passwordPayloadDto.setAccount(\"test\");\n passwordPayloadDto.setEmail(\"123@qq.com\");\n reqDto.setPasswordPayload(passwordPayloadDto);\n LoginTokenRespDto response = client.signInByCredentials(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n const result = await authenticationClient.signInByCredentials({\n connection: Models.SigninByCredentialsDto.connection.PASSWORD,\n passwordPayload: {\n password: 'passw0rd',\n email: 'test-user@example.com'\n },\n client_id: 'AUTHING_APP_ID',\n client_secret: 'AUTHING_APP_SECRET'\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n$data = $authenticationClient->signInByCredentials(\n array(\n \"connection\" => \"PASSWORD\",\n \"passwordPayload\" => array(\n \"username\" => \"test\",\n \"password\" => \"passw0rd\"\n ),\n \"client_id\" => $AUTHING_APP_ID,\n \"client_secret\" => $AUTHING_APP_SECRET\n )\n);\nprint_r($data);\n"}}},"/api/v3/signin-by-mobile":{"post":{"operationId":"SignInV3Controller_signInByMobile","x-authing-signin-api":true,"summary":"使用移动端社会化登录","description":"\n此端点为移动端社会化登录接口,使用第三方移动社会化登录返回的临时凭证登录,并换取用户的 `id_token` 和 `access_token`。请先阅读相应社会化登录的接入流程。\n\n\n注意事项:取决于你在 Authing 创建应用时选择的**应用类型**和应用配置的**换取 token 身份验证方式**,在调用此接口时需要对客户端的身份进行不同形式的验证。\n\n<details>\n<summary>点击展开详情</summary>\n\n<br>\n\n你可以在 [Authing 控制台](https://console.authing.cn) 的**应用** - **自建应用** - **应用详情** - **应用配置** - **其他设置** - **授权配置**\n中找到**换取 token 身份验证方式** 配置项:\n\n> 单页 Web 应用和客户端应用隐藏,默认为 `none`,不允许修改;后端应用和标准 Web 应用可以修改此配置项。\n\n![](https://files.authing.co/api-explorer/tokenAuthMethod.jpg)\n\n#### 换取 token 身份验证方式为 none 时\n\n调用此接口不需要进行额外操作。\n\n#### 换取 token 身份验证方式为 client_secret_post 时\n\n调用此接口时必须在 body 中传递 `client_id` 和 `client_secret` 参数,作为验证客户端身份的条件。其中 `client_id` 为应用 ID、`client_secret` 为应用密钥。\n\n#### 换取 token 身份验证方式为 client_secret_basic 时\n\n调用此接口时必须在 HTTP 请求头中携带 `authorization` 请求头,作为验证客户端身份的条件。`authorization` 请求头的格式如下(其中 `client_id` 为应用 ID、`client_secret` 为应用密钥。):\n\n```\nBasic base64(<client_id>:<client_secret>)\n```\n\n结果示例:\n\n```\nBasic NjA2M2ZiMmYzY3h4eHg2ZGY1NWYzOWViOjJmZTdjODdhODFmODY3eHh4eDAzMjRkZjEyZGFlZGM3\n```\n\nJS 代码示例:\n\n```js\n'Basic ' + Buffer.from(client_id + ':' + client_secret).toString('base64');\n```\n\n</details>\n\n ","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SigninByMobileDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginTokenRespDto"}}}}},"security":[{"x-authing-app-id":[]}],"tags":["登录/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n var res = await authenticationClient.SignInByMobile(new SigninByMobileDto()\r\n {\r\n Connection = SigninByMobileDto.connection.WECHAT,\r\n //填入外部身份源连接标志符\r\n ExtIdpConnidentifier = \"AUTHING_EXT_IDP_CONNIDENTIFIER\",\r\n });\r\n }\r\n }\r\n}\r\n","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t reqDto := &dto.SigninByMobileDto{\n // 需要替换为真实的外部身份源连接标志符\n\t\tExtIdpConnidentifier: \"xxx\",\n\t\tConnection: \"apple\",\n\t\tApplePayload: dto.SignInByApplePayloadDto{Code: \"xxx\"},\n\t\tClientId: \"AUTHING_APP_ID\",\n\t\tClientSecret: \"AUTHING_APP_SECRET\",\n\t}\n\trespDto := client.SignInByMobile(reqDto)\n\n\tfmt.Println(respDto)\n}\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n$data = $authenticationClient->signInByMobile(\n array(\n // 需要替换为真实的外部身份源连接标志符\n \"extIdpConnidentifier\" => \"xxxx\",\n \"connection\" => \"apple\",\n \"applePayload\" => array(\n \"code\" => \"xxx\"\n ),\n \"client_id\" => $AUTHING_APP_ID,\n \"client_secret\" => $AUTHING_APP_SECRET\n )\n);\nprint_r($data);\n"}}},"/api/v3/switch-login-by-user":{"post":{"operationId":"SignInV3Controller_switchLoginByUser","x-authing-signin-api":true,"summary":"公共账号切换登录","description":"允许个人账号与关联的公共账号间做切换登录,此端点要求账号已登录","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicAccountSwitchLoginDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginTokenRespDto"}}}}},"security":[{"x-authing-app-id":[]}],"tags":["登录/API 列表"]}},"/api/v3/get-alipay-authinfo":{"get":{"operationId":"SignInV3Controller_getAlipayAuthInfo","summary":"获取支付宝 AuthInfo","description":"此接口用于获取发起支付宝认证需要的[初始化参数 AuthInfo](https://opendocs.alipay.com/open/218/105325)。","parameters":[{"name":"extIdpConnidentifier","required":true,"in":"query","description":"外部身份源连接标志符","example":"wework","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAlipayAuthInfoRespDto"}}}}},"security":[{"x-authing-app-id":[]}],"tags":["登录/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //填入外部身份源连接标志符\r\n var res = await authenticationClient.GetAlipayAuthInfo(\"AUTHING_EXT_IDP_CONNIDENTIFIER\");\r\n }\r\n }\r\n}\r\n","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 需要替换为真实的外部身份源连接标志符\n\treqDto := &dto.GetAlipayAuthinfoDto{ExtIdpConnidentifier: \"xxxx\"}\n\trespDto := client.GetAlipayAuthInfo(reqDto)\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.GetAlipayAuthInfoRespDto;\nimport cn.authing.sdk.java.dto.GetAlipayAuthinfoDto;\nimport cn.authing.sdk.java.enums.AuthMethodEnum;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class GetAlipayAuthInfoTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n GetAlipayAuthinfoDto reqDto = new GetAlipayAuthinfoDto();\n reqDto.setExtIdpConnidentifier(\"123\");\n GetAlipayAuthInfoRespDto response = client.getAlipayAuthInfo(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n$data = $authenticationClient->getAlipayAuthInfo(\n array(\n // 需要替换为真实的外部身份源连接标志符\n \"extIdpConnidentifier\" => \"xxxx\",\n )\n);\nprint_r($data);\n"}}},"/api/v3/gene-qrcode":{"post":{"operationId":"SignInV3Controller_geneQRCode","summary":"生成用于登录的二维码","description":"生成用于登录的二维码,目前支持生成微信公众号扫码登录、小程序扫码登录、自建移动 APP 扫码登录的二维码。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateQrcodeDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeneQRCodeRespDto"}}}}},"security":[{"x-authing-app-id":[]}],"tags":["登录/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n var res = await authenticationClient.GeneQrCode(new GenerateQrcodeDto()\r\n {\r\n Type = GenerateQrcodeDto.type.MOBILE_APP\r\n });\r\n }\r\n }\r\n}\r\n","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t reqDto := &dto.GenerateQrcodeDto{\n // 需要替换为真实的外部身份源连接标志符\n\t\tType: \"WECHAT_OFFICIAL_ACCOUNT\",\n\t}\n\trespDto := client.GeneQrCode(reqDto)\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.GeneQRCodeRespDto;\nimport cn.authing.sdk.java.dto.GenerateQrcodeDto;\nimport cn.authing.sdk.java.enums.AuthMethodEnum;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class GeneQrCodeTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n GenerateQrcodeDto reqDto = new GenerateQrcodeDto();\n reqDto.setType(GenerateQrcodeDto.Type.MOBILE_APP);\n GeneQRCodeRespDto response = client.geneQrCode(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n$data = $authenticationClient->geneQrCode(\n array(\n // 需要替换为真实的外部身份源连接标志符\n \"type\" => \"WECHAT_OFFICIAL_ACCOUNT\",\n )\n);\nprint_r($data);\n"}}},"/api/v3/check-qrcode-status":{"get":{"operationId":"SignInV3Controller_checkQRCodeStatus","summary":"查询二维码状态","description":"按照用户扫码顺序,共分为未扫码、已扫码等待用户确认、用户同意/取消授权、二维码过期以及未知错误六种状态,前端应该通过不同的状态给到用户不同的反馈。你可以通过下面这篇文章了解扫码登录详细的流程:https://docs.authing.cn/v2/concepts/how-qrcode-works.html.","parameters":[{"name":"qrcodeId","required":true,"in":"query","description":"二维码唯一 ID","example":"","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckQRCodeStatusRespDto"}}}}},"security":[{"x-authing-app-id":[]}],"tags":["登录/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n var res = await authenticationClient.GeneQrCode(new GenerateQrcodeDto()\r\n {\r\n Type = GenerateQrcodeDto.type.MOBILE_APP\r\n });\r\n var res2 = await authenticationClient.CheckQrCodeStatus(res.Data.QrcodeId);\r\n }\r\n }\r\n}\r\n","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t reqDto := &dto.CheckQrcodeStatusDto{QrcodeId: \"xxxxx\"}\n respDto := client.CheckQrCodeStatus(reqDto)\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.CheckQRCodeStatusRespDto;\nimport cn.authing.sdk.java.dto.CheckQrcodeStatusDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class CheckQrCodeStatusTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n CheckQrcodeStatusDto reqDto = new CheckQrcodeStatusDto();\n reqDto.setQrcodeId(\"123\");\n CheckQRCodeStatusRespDto response = client.checkQrCodeStatus(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n$data = $authenticationClient->checkQrCodeStatus(\n array(\n \"qrcodeId\" => \"xxxx\",\n )\n);\nprint_r($data);\n"}}},"/api/v3/exchange-tokenset-with-qrcode-ticket":{"post":{"operationId":"SignInV3Controller_exchangeTokenSetWithQRCodeTicket","summary":"使用二维码 ticket 换取 TokenSet","description":"\n此端点为使用二维码的 ticket 换取用户的 `access_token` 和 `id_token`。\n\n\n注意事项:取决于你在 Authing 创建应用时选择的**应用类型**和应用配置的**换取 token 身份验证方式**,在调用此接口时需要对客户端的身份进行不同形式的验证。\n\n<details>\n<summary>点击展开详情</summary>\n\n<br>\n\n你可以在 [Authing 控制台](https://console.authing.cn) 的**应用** - **自建应用** - **应用详情** - **应用配置** - **其他设置** - **授权配置**\n中找到**换取 token 身份验证方式** 配置项:\n\n> 单页 Web 应用和客户端应用隐藏,默认为 `none`,不允许修改;后端应用和标准 Web 应用可以修改此配置项。\n\n![](https://files.authing.co/api-explorer/tokenAuthMethod.jpg)\n\n#### 换取 token 身份验证方式为 none 时\n\n调用此接口不需要进行额外操作。\n\n#### 换取 token 身份验证方式为 client_secret_post 时\n\n调用此接口时必须在 body 中传递 `client_id` 和 `client_secret` 参数,作为验证客户端身份的条件。其中 `client_id` 为应用 ID、`client_secret` 为应用密钥。\n\n#### 换取 token 身份验证方式为 client_secret_basic 时\n\n调用此接口时必须在 HTTP 请求头中携带 `authorization` 请求头,作为验证客户端身份的条件。`authorization` 请求头的格式如下(其中 `client_id` 为应用 ID、`client_secret` 为应用密钥。):\n\n```\nBasic base64(<client_id>:<client_secret>)\n```\n\n结果示例:\n\n```\nBasic NjA2M2ZiMmYzY3h4eHg2ZGY1NWYzOWViOjJmZTdjODdhODFmODY3eHh4eDAzMjRkZjEyZGFlZGM3\n```\n\nJS 代码示例:\n\n```js\n'Basic ' + Buffer.from(client_id + ':' + client_secret).toString('base64');\n```\n\n</details>\n\n ","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExchangeTokenSetWithQRcodeTicketDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginTokenRespDto"}}}}},"security":[{"x-authing-app-id":[]}],"tags":["登录/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n Host = \"AUTHING_HOST\"// Authing 主机的域名地址,如 https://core.authing.cn\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n var res = await authenticationClient.GeneQrCode(new GenerateQrcodeDto()\r\n {\r\n Type = GenerateQrcodeDto.type.MOBILE_APP\r\n });\r\n var res2 = await authenticationClient.CheckQrCodeStatus(res.Data.QrcodeId);\r\n var res3 = await authenticationClient.ExchangeTokenSetWithQrCodeTicket(new ExchangeTokenSetWithQRcodeTicketDto()\r\n {\r\n Ticket = res2.Data.Ticket\r\n });\r\n }\r\n }\r\n}\r\n","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t reqDto := &dto.ExchangeTokenSetWithQRcodeTicketDto{\n Ticket: \"xxxx\",\n ClientId: \"AUTHING_APP_ID\",\n ClientSecret: \"AUTHING_APP_SECRET\",\n }\n respDto := client.ExchangeTokenSetWithQrCodeTicket(reqDto)\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.ExchangeTokenSetWithQRcodeTicketDto;\nimport cn.authing.sdk.java.dto.LoginTokenRespDto;\nimport cn.authing.sdk.java.enums.AuthMethodEnum;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class ExchangeTokenSetWithQrCodeTicketTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setTokenEndPointAuthMethod(AuthMethodEnum.CLIENT_SECRET_BASIC.getValue());\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n ExchangeTokenSetWithQRcodeTicketDto reqDto = new ExchangeTokenSetWithQRcodeTicketDto();\n // 可查询二维码状态获取, 当二维码状态为已授权时返回\n reqDto.setTicket(\"REPLACE_WITH_REAL_TICKET\");\n LoginTokenRespDto response = client.exchangeTokenSetWithQrCodeTicket(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n$data = $authenticationClient->exchangeTokenSetWithQrCodeTicket(\n array(\n \"ticket\" => \"xxxx\",\n \"client_id\" => $AUTHING_APP_ID,\n \"client_secret\" => $AUTHING_APP_SECRET\n )\n);\nprint_r($data);\n"}}},"/api/v3/captcha-code":{"get":{"operationId":"SignInV3Controller_geneCaptchaCode","x-authing-hidden-from-sdk":true,"summary":"生成图形验证码","description":"当用户池开启**登录失败次数限制**并且**登录安全策略**设置为**验证码**时,如果当前请求触发登录失败次数上限,要求用户输入图形验证码。此接口用于在前端生成图形验证码,会返回一个 `content-type` 为 `image/svg+xml` 的响应。","parameters":[{"name":"r","required":false,"in":"query","description":"随机字符串或者时间戳,防止浏览器缓存","example":"1660291866076","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"x-authing-app-id":[]}],"tags":["登录/API 列表"]}},"/api/v3/change-qrcode-status":{"post":{"operationId":"SignInV3Controller_changeQRCodeStatus","summary":"自建 APP 扫码登录:APP 端修改二维码状态","description":"此端点用于在自建 APP 扫码登录中修改二维码状态,对应着在浏览器渲染出二维码之后,终端用户扫码、确认授权、取消授权的过程。**此接口要求具备用户的登录态**。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeQRCodeStatusDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommonResponseDto"}}}}},"security":[{"x-authing-app-id":[]}],"tags":["登录/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n var res = await authenticationClient.GeneQrCode(new GenerateQrcodeDto()\r\n {\r\n Type = GenerateQrcodeDto.type.MOBILE_APP\r\n });\r\n var res2 = await authenticationClient.ChangeQrCodeStatus(new ChangeQRCodeStatusDto()\r\n {\r\n QrcodeId = res.Data.QrcodeId,\r\n Action = ChangeQRCodeStatusDto.action.SCAN\r\n });\r\n }\r\n }\r\n}\r\n","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n reqDto := &dto.ChangeQRCodeStatusDto{\n Action: \"CONFIRM\",\n QrcodeId: \"xxxxx\",\n }\n respDto := client.ChangeQrCodeStatus(reqDto)\n\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.ChangeQRCodeStatusDto;\nimport cn.authing.sdk.java.dto.CommonResponseDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class ChangeQrCodeStatusTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n ChangeQRCodeStatusDto reqDto = new ChangeQRCodeStatusDto();\n reqDto.setQrcodeId(\"123\");\n reqDto.setAction(ChangeQRCodeStatusDto.Action.CONFIRM);\n CommonResponseDto response = client.changeQrCodeStatus(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"USER_ACCESS_TOKEN\");\n\n$data = $authenticationClient->changeQrCodeStatus(\n array(\n \"qrcodeId\" => \"xxxxx\",\n \"action\" => \"CONFIRM\",\n )\n);\nprint_r($data);\n"}}},"/api/v3/get-app-login-qrcode-status":{"get":{"operationId":"SignInV3Controller_getQRCodeStatus","summary":"查询个人中心「快速认证二维码」的状态","description":"按照用户扫码顺序,共分为未扫码、已扫码、已登录、二维码过期以及未知错误五种状态,前端应该通过不同的状态给到用户不同的反馈。","parameters":[{"name":"qrcodeId","required":true,"in":"query","description":"二维码唯一 ID","example":"","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckQRCodeStatusRespDto"}}}}},"security":[{"x-authing-app-id":[]}]}},"/api/v3/qrcode-app-login":{"post":{"operationId":"SignInV3Controller_qrCodeAppLogin","summary":"APP 端扫码登录","description":"此端点用于在授权使 APP 成功扫码登录中,对应着在「个人中心」-「快速认证」页面渲染出二维码,终端用户扫码并成功登录的过程。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppQRCodeLoginDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginTokenRespDto"}}}}},"security":[{"x-authing-app-id":[]}]}},"/api/v3/signin-by-push":{"post":{"operationId":"SignInV3Controller_signInByPush","summary":"推送登录","description":"推送登录。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignInByPushDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenePushCodeRespDto"}}}}},"security":[{"x-authing-app-id":[]}],"tags":["登录/API 列表"]}},"/api/v3/check-pushcode-status":{"get":{"operationId":"SignInV3Controller_checkPushCodeStatus","summary":"查询推送码状态","description":"按照推送码使用顺序,共分为已推送、等待用户 同意/取消 授权、推送码过期以及未知错误五种状态,前端应该通过不同的状态给到用户不同的反馈。","parameters":[{"name":"pushCodeId","required":true,"in":"query","description":"推送码(推送登录唯一 ID)","example":"","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckPushCodeStatusRespDto"}}}}},"security":[{"x-authing-app-id":[]}],"tags":["登录/API 列表"]}},"/api/v3/change-pushcode-status":{"post":{"operationId":"SignInV3Controller_changePushCodeStatus","summary":"推送登录:APP 端修改推送码状态","description":"此端点用于在 Authing 令牌 APP 推送登录中修改推送码状态,对应着在浏览器使用推送登录,点击登录之后,终端用户收到推送登录信息,确认授权、取消授权的过程。**此接口要求具备用户的登录态**。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePushCodeStatusDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommonResponseDto"}}}}},"security":[{"x-authing-app-id":[]}],"tags":["登录/API 列表"]}},"/api/v3/get-pushlogin-relation-apps":{"post":{"operationId":"SignInV3Controller_getPushLoginRelationApps","summary":"获取推送登录请求关联的客户端应用","description":"此端点用于在 Authing 令牌 APP 收到推送登录通知时,可检查当前用户登录的应用是否支持对推送登录请求进行授权。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetPushCodeRelationAppsDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetPushCodeRelationAppsRespDto"}}}}},"security":[{"x-authing-app-id":[]}],"tags":["登录/推送登录"]}},"/api/v3/gene-fastpass-qrcode-info":{"post":{"operationId":"SignInV3Controller_geneFastpassQrcodeInfo","summary":"获取快速认证二维码数据","description":"此端点用于在用户个人中心,获取快速认证参数生成二维码,可使用 Authing 令牌 APP 扫码,完成快速认证。**此接口要求具备用户的登录态**。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignInFastpassDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeneFastpassQRCodeRespDto"}}}}},"security":[{"x-authing-app-id":[]}],"tags":["登录/快速认证"]}},"/api/v3/get-fastpass-client-apps":{"get":{"operationId":"SignInV3Controller_getFastpassParams","summary":"获取快速认证的应用列表","description":"此端点用于使用 Authing 令牌 APP 扫「用户个人中心」-「快速认证」二维码后,拉取可快速认证的客户端应用列表。","parameters":[{"name":"qrcodeId","required":true,"in":"query","schema":{"type":"string"}},{"name":"appId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetFastpassQRCodeRelationAppsRespDto"}}}}},"security":[{"x-authing-app-id":[]}],"tags":["登录/快速认证"]}},"/api/v3/send-sms":{"post":{"operationId":"MessageV3Controller_sendSms","summary":"发送短信","description":"发送短信时必须指定短信 Channel,每个手机号同一 Channel 在一分钟内只能发送一次。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendSMSDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendSMSRespDto"}}}}},"security":[{"bearer":[]}],"tags":["消息服务/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n \r\n var res = await authenticationClient.SendSms(new SendSMSDto()\r\n {\r\n PhoneNumber = \"AUTHING_PHONE\",\r\n Channel = SendSMSDto.channel.CHANNEL_REGISTER\r\n });\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t reqDto := &dto.SendSMSDto{\n\t\tChannel: \"CHANNEL_LOGIN\",\n\t\tPhoneNumber: \"188xxxx8888\",\n\t}\n\trespDto := client.SendSms(reqDto)\n\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.SendSMSDto;\nimport cn.authing.sdk.java.dto.SendSMSRespDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class SendSmsTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n SendSMSDto reqDto = new SendSMSDto();\n reqDto.setChannel(SendSMSDto.Channel.CHANNEL_BIND_MFA);\n reqDto.setPhoneNumber(\"123456\");\n SendSMSRespDto response = client.sendSms(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n const result = await authenticationClient.sendSms({\n phoneNumber: '188xxxx8888',\n channel: Models.SendSMSDto.channel.CHANNEL_LOGIN,\n phoneCountryCode: '+86'\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n$data = $authenticationClient->sendSms(array(\n \"channel\" => \"CHANNEL_LOGIN\",\n \"phoneNumber\" => \"188xxxx8888\"\n));\nprint_r($data);\n"}}},"/api/v3/send-email":{"post":{"operationId":"MessageV3Controller_sendEmail","summary":"发送邮件","description":"发送邮件时必须指定邮件 Channel,每个邮箱同一 Channel 在一分钟内只能发送一次。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailRespDto"}}}}},"security":[{"bearer":[]}],"tags":["消息服务/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n \r\n var res = await authenticationClient.SendEmail(new SendEmailDto()\r\n {\r\n Email = \"AUTHING_EMAIL\",\r\n Channel = SendEmailDto.channel.CHANNEL_REGISTER\r\n });\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n reqDto := &dto.SendEmailDto{\n\t\tChannel: \"CHANNEL_LOGIN\",\n\t\tEmail: \"test@example.com\",\n\t}\n\trespDto := client.SendEmail(reqDto)\n\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.SendEmailDto;\nimport cn.authing.sdk.java.dto.SendEmailRespDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class SendEmailTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n SendEmailDto reqDto = new SendEmailDto();\n reqDto.setChannel(SendEmailDto.Channel.CHANNEL_COMPLETE_EMAIL);\n reqDto.setEmail(\"123@qq.com\");\n SendEmailRespDto response = client.sendEmail(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n const result = await authenticationClient.sendEmail({\n email: 'test@example.com',\n channel: Models.SendEmailDto.channel.CHANNEL_LOGIN\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"ACCESS_TOKEN\");\n\n$data = $authenticationClient->sendEmail(array(\n \"channel\" => \"CHANNEL_LOGIN\",\n \"email\" => \"test@example.com\"\n));\nprint_r($data);\n"}}},"/api/v3/pre-check-code":{"post":{"operationId":"MessageV3Controller_preCheckCode","summary":"预检验验证码是否正确","description":"预检测验证码是否有效,此检验不会使得验证码失效。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreCheckCodeDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreCheckCodeRespDto"}}}}},"security":[{"bearer":[]}]}},"/api/v3/decrypt-wechat-miniprogram-data":{"post":{"operationId":"WechatAPIV3Controller_decryptWechatMiniProgramData","summary":"解密微信小程序数据","description":"解密微信小程序数据","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecryptWechatMiniProgramDataDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecryptWechatMiniProgramDataRespDto"}}}}},"security":[{"bearer":[]}],"tags":["微信相关接口/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n \r\n var param = new DecryptWechatMiniProgramDataDto();\r\n var res = await authenticationClient.DecryptWechatMiniProgramData(param);\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t reqDto := &dto.DecryptWechatMiniProgramDataDto{\n Code: \"xxxx\",\n Iv: \"xxxx\",\n EncryptedData: \"xxxx\",\n // 需要替换成微信小程序的外部身份源连接标志符\n ExtIdpConnidentifier: \"xxxx\",\n }\n respDto := client.DecryptWechatMiniProgramData(reqDto)\n\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.DecryptWechatMiniProgramDataDto;\nimport cn.authing.sdk.java.dto.DecryptWechatMiniProgramDataRespDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class DecryptWechatMiniProgramDataTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n DecryptWechatMiniProgramDataDto reqDto = new DecryptWechatMiniProgramDataDto();\n reqDto.setCode(\"xxx\");\n reqDto.setIv(\"xxx\");\n reqDto.setEncryptedData(\"xxx\");\n reqDto.setExtIdpConnidentifier(\"my-wxapp\");\n DecryptWechatMiniProgramDataRespDto response = client.decryptWechatMiniProgramData(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n const result = await authenticationClient.decryptWechatMiniProgramData({\n extIdpConnidentifier: 'my-wxapp',\n encryptedData: 'xxxxxx',\n iv: 'xxxxxx',\n code: 'xxxxxx'\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n$data = $authenticationClient->decryptWechatMiniProgramData(array(\n // 需要替换成微信小程序的外部身份源连接标志符\n \"extIdpConnidentifier\" => \"xxxxx\",\n \"code\" => \"xxxxx\",\n \"iv\" => \"xxxx\",\n \"encryptedData\" => \"xxxxx\"\n));\nprint_r($data);\n"}}},"/api/v3/get-wechat-miniprogram-phone":{"post":{"operationId":"WechatAPIV3Controller_getWechatMiniprogramPhone","x-authing-hidden-from-sdk":true,"summary":"获取小程序的手机号","description":"获取小程序的手机号","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetWechatMiniProgramPhoneDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetWechatMiniProgramPhoneRespDto"}}}}},"security":[{"bearer":[]}],"tags":["微信相关接口/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n \r\n var param = new GetWechatMiniProgramPhoneDto();\r\n var res = await authenticationClient.GetWechatMiniprogramPhone(param);\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t reqDto := &dto.GetWechatMiniProgramPhoneDto{\n\t\tCode: \"xxxx\",\n\t\t// 需要替换成微信小程序的外部身份源连接标志符\n\t\tExtIdpConnidentifier: \"xxxx\",\n\t}\n\trespDto := client.GetWechatMiniprogramPhone(reqDto)\n\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.GetWechatMiniProgramPhoneDto;\nimport cn.authing.sdk.java.dto.GetWechatMiniProgramPhoneRespDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class GetWechatMiniprogramPhoneTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n GetWechatMiniProgramPhoneDto reqDto = new GetWechatMiniProgramPhoneDto();\n reqDto.setCode(\"xxx\");\n reqDto.setExtIdpConnidentifier(\"my-wxapp\");\n GetWechatMiniProgramPhoneRespDto response = client.getWechatMiniprogramPhone(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n const result = await authenticationClient.getWechatMiniprogramPhone({\n extIdpConnidentifier: 'my-wxapp',\n code: 'xxxx'\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n$data = $authenticationClient->getWechatMiniprogramPhone(array(\n // 需要替换成微信小程序的外部身份源连接标志符\n \"extIdpConnidentifier\" => \"xxxxx\",\n \"code\" => \"xxxxx\",\n));\nprint_r($data);\n"}}},"/api/v3/get-wechat-access-token":{"post":{"operationId":"WechatAPIV3Controller_getWechatMpAccessToken","summary":"获取微信小程序、公众号 Access Token","deprecated":true,"description":"获取 Authing 服务器缓存的微信小程序、公众号 Access Token(废弃,请使用 /api/v3/get-wechat-access-token-info)","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetWechatAccessTokenDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetWechatAccessTokenRespDto"}}}}},"security":[{"bearer":[]}],"tags":["微信相关接口/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n \r\n var param = new GetWechatAccessTokenDto();\r\n var res = await authenticationClient.GetWechatMpAccessToken(param);\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t reqDto := &dto.GetWechatAccessTokenDto{\n\t\tAppSecret: \"xxxx\",\n\t\tAppId: \"xxxx\",\n\t}\n\trespDto := client.GetWechatMpAccessToken(reqDto)\n\tfmt.Println(respDto)\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.GetWechatAccessTokenDto;\nimport cn.authing.sdk.java.dto.GetWechatAccessTokenRespDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class GetWechatMpAccessTokenTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n GetWechatAccessTokenDto reqDto = new GetWechatAccessTokenDto();\n reqDto.setAppId(APP_ID);\n reqDto.setAppSecret(APP_SECRET);\n GetWechatAccessTokenRespDto response = client.getWechatMpAccessToken(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n const result = await authenticationClient.getWechatMpAccessToken({\n appId: 'xxxx',\n appSecret: 'xxxx'\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n$data = $authenticationClient->getWechatMpAccessToken(array(\n \"appId\" => \"xxxxx\",\n \"appSecret\" => \"xxxxx\",\n));\nprint_r($data);\n"}}},"/api/v3/get-wechat-access-token-info":{"post":{"operationId":"WechatAPIV3Controller_getWechatMpAccessTokenInfo","summary":"获取微信小程序、公众号 Access Token","description":"获取 Authing 服务器缓存的微信小程序、公众号 Access Token","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetWechatAccessTokenDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetWechatAccessTokenInfoRespDto"}}}}},"security":[{"bearer":[]}],"tags":["微信相关接口/API 列表"]}},"/api/v3/get-my-login-history":{"get":{"operationId":"UserRelatedResourceAPIV3Controller_getLoginHistory","summary":"获取登录日志","description":"获取登录日志","parameters":[{"name":"appId","required":false,"in":"query","description":"应用 ID,可根据应用 ID 筛选。默认不传获取所有应用的登录历史。","example":"5f6265c67fxxxxae64ec516e","schema":{"type":"string"}},{"name":"clientIp","required":false,"in":"query","description":"客户端 IP,可根据登录时的客户端 IP 进行筛选。默认不传获取所有登录 IP 的登录历史。","example":"127.0.0.1","schema":{"type":"string"}},{"name":"success","required":false,"in":"query","description":"是否登录成功,可根据是否登录成功进行筛选。默认不传获取的记录中既包含成功也包含失败的的登录历史。","example":true,"schema":{"type":"boolean"}},{"name":"start","required":false,"in":"query","description":"开始时间,为单位为毫秒的时间戳","example":1660828100000,"schema":{"type":"number"}},{"name":"end","required":false,"in":"query","description":"结束时间,为单位为毫秒的时间戳","example":1660828100000,"schema":{"type":"number"}},{"name":"page","required":false,"in":"query","description":"当前页数,从 1 开始","example":1,"schema":{"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"每页数目,最大不能超过 50,默认为 10","example":10,"schema":{"default":10,"type":"number"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetLoginHistoryRespDto"}}}}},"security":[{"bearer":[]}],"tags":["用户相关资源/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var res = await authenticationClient.GetLoginHistory();\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n reqDto := &dto.GetMyLoginHistoryDto{\n // 根据应用 ID 筛选,可选,需要替换成真实的 appId\n\t\tAppId: \"xxx\",\n\t\tPage: 1,\n\t\tLimit: 10,\n\t}\n\trespDto := client.GetLoginHistory(reqDto)\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.GetLoginHistoryRespDto;\nimport cn.authing.sdk.java.dto.GetMyLoginHistoryDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class GetLoginHistoryTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n GetMyLoginHistoryDto reqDto = new GetMyLoginHistoryDto();\n GetLoginHistoryRespDto response = client.getLoginHistory(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.getLoginHistory({\n appId: '635143ae1xxxxx9afb54c39',\n page: 1,\n limit: 10\n });\n\n\n// 空返回\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"ACCESS_TOKEN\");\n\n$data = $authenticationClient->getLoginHistory(array(\n # 根据应用 ID 筛选,可选,需要替换成真实的 appId\n \"appId\" => \"xxxx\"\n));\nprint_r($data);\n"}}},"/api/v3/get-my-logged-in-apps":{"get":{"operationId":"UserRelatedResourceAPIV3Controller_getLoggedInApps","summary":"获取登录应用","description":"获取登录应用","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetLoggedInAppsRespDto"}}}}},"security":[{"bearer":[]}],"tags":["用户相关资源/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var res = await authenticationClient.GetLoggedInApps();\r\n }\r\n }\r\n}","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.GetLoggedInAppsRespDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class GetLoggedInAppsTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n GetLoggedInAppsRespDto response = client.getLoggedInApps();\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.getLoggedInApps();\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n"}}},"/api/v3/get-my-accessible-apps":{"get":{"operationId":"UserRelatedResourceAPIV3Controller_getAccessibleApps","summary":"获取具备访问权限的应用","description":"获取具备访问权限的应用","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAccessibleAppsRespDto"}}}}},"security":[{"bearer":[]}],"tags":["用户相关资源/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var res = await authenticationClient.GetAccessibleApps();\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n respDto := client.GetAccessibleApps()\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.GetAccessibleAppsRespDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class GetAccessibleAppsTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n GetAccessibleAppsRespDto response = client.getAccessibleApps();\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.getAccessibleApps();\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"ACCESS_TOKEN\");\n\n$data = $authenticationClient->getAccessibleApps();\nprint_r($data);\n"}}},"/api/v3/get-my-tenant-list":{"get":{"operationId":"UserRelatedResourceAPIV3Controller_getTenantList","summary":"获取租户列表","description":"获取租户列表","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTenantListRespDto"}}}}},"security":[{"bearer":[]}],"tags":["用户相关资源/API 列表","多租户用户相关资源/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var res = await authenticationClient.GetTenantList();\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n respDto := client.GetTenantList()\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.GetTenantListRespDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class GetTenantListTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n GetTenantListRespDto response = client.getTenantList();\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.getTenantList();\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"ACCESS_TOKEN\");\n\n$data = $authenticationClient->getTenantList();\nprint_r($data);\n"}}},"/api/v3/get-my-role-list":{"get":{"operationId":"UserRelatedResourceAPIV3Controller_getRoleList","summary":"获取角色列表","description":"获取角色列表","parameters":[{"name":"namespace","required":false,"in":"query","description":"所属权限分组(权限空间)的 Code","example":"default","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleListRespDto"}}}}},"security":[{"bearer":[]}],"tags":["用户相关资源/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var res = await authenticationClient.GetRoleList();\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n reqDto := &dto.GetMyRoleListDto{Namespace: \"default\"}\n\trespDto := client.GetRoleList(reqDto)\n\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.GetMyRoleListDto;\nimport cn.authing.sdk.java.dto.RoleListRespDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class GetRoleListTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n RoleListRespDto response = client.getRoleList(new GetMyRoleListDto());\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.getRoleList({\n namespace: 'default'\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"ACCESS_TOKEN\");\n\n$data = $authenticationClient->getRoleList();\nprint_r($data);\n"}}},"/api/v3/get-my-group-list":{"get":{"operationId":"UserRelatedResourceAPIV3Controller_getGroupList","summary":"获取分组列表","description":"获取分组列表","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupListRespDto"}}}}},"security":[{"bearer":[]}],"tags":["用户相关资源/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var res = await authenticationClient.GetGroupList();\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n respDto := client.GetGroupList()\n\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.GroupListRespDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class GetGroupListTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n GroupListRespDto response = client.getGroupList();\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.getGroupList();\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"ACCESS_TOKEN\");\n\n$data = $authenticationClient->getGroupList();\nprint_r($data);\n"}}},"/api/v3/get-my-department-list":{"get":{"operationId":"UserRelatedResourceAPIV3Controller_getDepartmentList","summary":"获取部门列表","description":"此接口用于获取用户的部门列表,可根据一定排序规则进行排序。","parameters":[{"name":"page","required":false,"in":"query","description":"当前页数,从 1 开始","example":1,"schema":{"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"每页数目,最大不能超过 50,默认为 10","example":10,"schema":{"default":10,"type":"number"}},{"name":"withCustomData","required":false,"in":"query","description":"是否获取部门的自定义数据","example":true,"schema":{"default":false,"type":"boolean"}},{"name":"sortBy","required":false,"in":"query","description":"排序依据,如 部门创建时间、加入部门时间、部门名称、部门标志符","example":"JoinDepartmentAt","schema":{"default":"JoinDepartmentAt","enum":["DepartmentCreatedAt","JoinDepartmentAt","DepartmentName","DepartmemtCode"],"type":"string"}},{"name":"orderBy","required":false,"in":"query","description":"增序或降序","example":"Desc","schema":{"default":"Desc","enum":["Asc","Desc"],"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserDepartmentPaginatedRespDto"}}}}},"security":[{"bearer":[]}],"tags":["用户相关资源/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var res = await authenticationClient.GetDepartmentList();\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n reqDto := &dto.GetMyDepartmentListDto{\n\t\tPage: 1,\n\t\tLimit: 10,\n\t}\n\trespDto := client.GetDepartmentList(reqDto)\n\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.GetMyDepartmentListDto;\nimport cn.authing.sdk.java.dto.UserDepartmentPaginatedRespDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class GetDepartmentListTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n UserDepartmentPaginatedRespDto response = client.getDepartmentList(new GetMyDepartmentListDto());\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.getDepartmentList({\n page: 1,\n limit: 10,\n withCustomData: true\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"ACCESS_TOKEN\");\n\n$data = $authenticationClient->getDepartmentList();\nprint_r($data);\n"}}},"/api/v3/get-my-authorized-resources":{"get":{"operationId":"UserRelatedResourceAPIV3Controller_getAuthorizedResources","summary":"获取被授权的资源列表","description":"此接口用于获取用户被授权的资源列表。","parameters":[{"name":"namespace","required":false,"in":"query","description":"所属权限分组(权限空间)的 Code","example":"default","schema":{"type":"string"}},{"name":"resourceType","required":false,"in":"query","description":"资源类型,如 数据、API、菜单、按钮","schema":{"enum":["DATA","API","MENU","BUTTON","UI"],"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizedResourcePaginatedRespDto"}}}}},"security":[{"bearer":[]}],"tags":["用户相关资源/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var res = await authenticationClient.GetAuthorizedResources(\"AUTHING_RESOURCE_TYPE\", \"AUTHING_RESOURCE_NAMESPACE\");\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n reqDto := &dto.GetMyAuthorizedResourcesDto{\n\t\tNamespace: \"default\",\n\t\tResourceType: \"API\",\n\t}\n\trespDto := client.GetAuthorizedResources(reqDto)\n\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.AuthorizedResourcePaginatedRespDto;\nimport cn.authing.sdk.java.dto.GetMyAuthorizedResourcesDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class GetAuthorizedResourcesTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n AuthorizedResourcePaginatedRespDto response = client.getAuthorizedResources(new GetMyAuthorizedResourcesDto());\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.getAuthorizedResources({\n namespace: 'default'\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"ACCESS_TOKEN\");\n\n$data = $authenticationClient->getAuthorizedResources();\nprint_r($data);\n"}}},"/api/v3/get-profile":{"get":{"operationId":"ProfileV3Controller_getProfile","summary":"获取用户资料","description":"此端点用户获取用户资料,需要在请求头中带上用户的 `access_token`,Authing 服务器会根据用户 `access_token` 中的 `scope` 返回对应的字段。","parameters":[{"name":"withCustomData","required":false,"in":"query","description":"是否获取自定义数据","example":true,"schema":{"default":false,"type":"boolean"}},{"name":"withIdentities","required":false,"in":"query","description":"是否获取 identities","example":true,"schema":{"default":false,"type":"boolean"}},{"name":"withDepartmentIds","required":false,"in":"query","description":"是否获取部门 ID 列表","example":true,"schema":{"default":false,"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSingleRespDto"}}}}},"security":[{"x-authing-userpool-id":[]},{"bearer":[]}],"tags":["用户资料/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n var res = await authenticationClient.GetProfile();\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n reqDto := &dto.GetProfileDto{\n\t\tWithCustomData: false,\n\t\tWithIdentities: false,\n\t\tWithDepartmentIds: false,\n\t}\n\trespDto := client.GetProfile(reqDto)\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.GetProfileDto;\nimport cn.authing.sdk.java.dto.UserSingleRespDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class GetProfileTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n UserSingleRespDto response = client.getProfile(new GetProfileDto());\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.getProfile({\n withCustomData: true,\n withIdentities: true,\n withDepartmentIds: true\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"USER_ACCESS_TOKEN\");\n\n$data = $authenticationClient->getProfile();\nprint_r($data);\n"}}},"/api/v3/update-profile":{"post":{"operationId":"ProfileV3Controller_updateProfile","summary":"修改用户资料","description":"此接口用于修改用户的用户资料,包含用户的自定义数据。如果需要**修改邮箱**、**修改手机号**、**修改密码**,请使用对应的单独接口。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserProfileDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSingleRespDto"}}}}},"security":[{"x-authing-userpool-id":[]},{"bearer":[]}],"tags":["用户资料/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n var res = await authenticationClient.UpdateProfile(new UpdateUserProfileDto()\r\n {\r\n Gender = UpdateUserProfileDto.gender.M\r\n });\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n reqDto := &dto.UpdateUserProfileDto{\n\t\tNickname: \"john\",\n\t}\n\trespDto := client.UpdateProfile(reqDto)\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.UpdateUserProfileDto;\nimport cn.authing.sdk.java.dto.UserSingleRespDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class UpdateProfileTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n UserSingleRespDto response = client.updateProfile(new UpdateUserProfileDto());\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.updateProfile({\n name: '张三',\n nickname: '张三',\n photo: 'https://files.authing.co/authing-console/default-user-avatar.png',\n birthdate: '2022-06-03',\n country: 'CN',\n province: 'BJ',\n city: 'BJ',\n address: '北京朝阳',\n streetAddress: '北京朝阳区 xxx 街道',\n postalCode: '438100',\n customData: {\n school: '北京大学',\n age: 22\n }\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"USER_ACCESS_TOKEN\");\n\n$data = $authenticationClient->updateProfile(array(\n \"nickname\" => \"张三\"\n));\nprint_r($data);\n"}}},"/api/v3/bind-email":{"post":{"operationId":"ProfileV3Controller_bindEmail","summary":"绑定邮箱","description":"如果用户还**没有绑定邮箱**,此接口可用于用户**自主**绑定邮箱。如果用户已经绑定邮箱想要修改邮箱,请使用**修改邮箱**接口。你需要先调用**发送邮件**接口发送邮箱验证码。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindEmailDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommonResponseDto"}}}}},"security":[{"x-authing-userpool-id":[]},{"bearer":[]}],"tags":["用户资料/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var res1 = await authenticationClient.SendEmail(new SendEmailDto()\r\n {\r\n Email = \"AUTHING_EMAIL\",\r\n Channel = SendEmailDto.channel.CHANNEL_BIND_EMAIL\r\n });\r\n var res2 = await authenticationClient.BindEmail(new BindEmailDto()\r\n {\r\n Email = \"AUTHING_EMAIL\",\r\n PassCode = \"AUTHING_CODE\",\r\n });\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n reqDto := &dto.BindEmailDto{\n PassCode: \"1234\",\n Email: \"test@example.com\",\n }\n respDto := client.BindEmail(reqDto)\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.BindEmailDto;\nimport cn.authing.sdk.java.dto.CommonResponseDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class BindEmailTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n BindEmailDto reqDto = new BindEmailDto();\n reqDto.setEmail(\"123@qq.com\");\n reqDto.setPassCode(\"123\");\n CommonResponseDto response = client.bindEmail(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.bindEmail({\n email: 'test@qq.com',\n passCode: '123456'\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"USER_ACCESS_TOKEN\");\n\n$data = $authenticationClient->bindEmail(array(\n \"email\" => \"test@example.com\",\n \"passCode\" => \"1234\"\n));\nprint_r($data);\n"}}},"/api/v3/unbind-email":{"post":{"operationId":"ProfileV3Controller_unbindEmail","summary":"解绑邮箱","description":"用户解绑邮箱,如果用户没有绑定其他登录方式(手机号、社会化登录账号),将无法解绑邮箱,会提示错误。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnbindEmailDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommonResponseDto"}}}}},"security":[{"x-authing-userpool-id":[]},{"bearer":[]}],"tags":["用户资料/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var res = await authenticationClient.UnbindEmail(new UnbindEmailDto());\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n reqDto := &dto.UnbindEmailDto{}\n\trespDto := client.UnbindEmail(reqDto)\n\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.CommonResponseDto;\nimport cn.authing.sdk.java.dto.UnbindEmailDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class UnbindEmailTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n CommonResponseDto response = client.unbindEmail(new UnbindEmailDto());\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.unbindEmail({});\n\n\n\n// 必须传空对象\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"USER_ACCESS_TOKEN\");\n\n$data = $authenticationClient->unbindEmail();\nprint_r($data);\n"}}},"/api/v3/bind-phone":{"post":{"operationId":"ProfileV3Controller_bindPhone","summary":"绑定手机号","description":"如果用户还**没有绑定手机号**,此接口可用于用户**自主**绑定手机号。如果用户已经绑定手机号想要修改手机号,请使用**修改手机号**接口。你需要先调用**发送短信**接口发送短信验证码。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindPhoneDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommonResponseDto"}}}}},"security":[{"x-authing-userpool-id":[]},{"bearer":[]}],"tags":["用户资料/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var res1 = await authenticationClient.SendSms(new SendSMSDto()\r\n {\r\n PhoneNumber = \"AUTHING_PHONE\",\r\n Channel = SendSMSDto.channel.CHANNEL_BIND_PHONE\r\n });\r\n var res2 = await authenticationClient.BindPhone(new BindPhoneDto()\r\n {\r\n PhoneNumber = \"AUTHING_PHONE\",\r\n PassCode = \"AUTHING_CODE\",\r\n });\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n reqDto := &dto.BindPhoneDto{\n PassCode: \"1234\",\n PhoneNumber: \"155xxxx6535\",\n }\n respDto := client.BindPhone(reqDto)\n\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.BindPhoneDto;\nimport cn.authing.sdk.java.dto.CommonResponseDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class BindPhoneTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n BindPhoneDto reqDto = new BindPhoneDto();\n reqDto.setPassCode(\"123\");\n reqDto.setPhoneNumber(\"123456\");\n CommonResponseDto response = client.bindPhone(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.bindPhone({\n phoneNumber: '188xxxx8888',\n passCode: '123456',\n phoneCountryCode: '+86'\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"USER_ACCESS_TOKEN\");\n\n$data = $authenticationClient->bindPhone(\n array(\n \"phoneNumber\" => \"188xxxx8888\",\n \"passCode\" => \"1234\"\n )\n);\nprint_r($data);\n"}}},"/api/v3/unbind-phone":{"post":{"operationId":"ProfileV3Controller_unbindPhone","summary":"解绑手机号","description":"用户解绑手机号,如果用户没有绑定其他登录方式(邮箱、社会化登录账号),将无法解绑手机号,会提示错误。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnbindPhoneDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommonResponseDto"}}}}},"security":[{"x-authing-userpool-id":[]},{"bearer":[]}],"tags":["用户资料/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var res = await authenticationClient.UnbindPhone(new UnbindPhoneDto{});\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n reqDto := &dto.UnbindPhoneDto{}\n\trespDto := client.UnbindPhone(reqDto)\n\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.CommonResponseDto;\nimport cn.authing.sdk.java.dto.UnbindPhoneDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class UnbindPhoneTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n CommonResponseDto response = client.unbindPhone(new UnbindPhoneDto());\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.unbindPhone({});\n\n\n// 必须传空对象\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"USER_ACCESS_TOKEN\");\n\n$data = $authenticationClient->unbindPhone();\nprint_r($data);\n"}}},"/api/v3/get-security-info":{"get":{"operationId":"ProfileV3Controller_getSecurityLevel","summary":"获取密码强度和账号安全等级评分","description":"获取用户的密码强度和账号安全等级评分,需要在请求头中带上用户的 `access_token`。","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetSecurityInfoRespDto"}}}}},"security":[{"x-authing-userpool-id":[]},{"bearer":[]}],"tags":["用户资料/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n var res = await authenticationClient.GetSecurityLevel();\r\n }\r\n }\r\n}","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.GetSecurityInfoRespDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class GetSecurityLevelTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n GetSecurityInfoRespDto response = client.getSecurityLevel();\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.getSecurityLevel();\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n"}}},"/api/v3/update-password":{"post":{"operationId":"ProfileV3Controller_updatePassword","summary":"修改密码","description":"此端点用于用户自主修改密码,如果用户之前已经设置密码,需要提供用户的原始密码作为凭证。如果用户忘记了当前密码,请使用**忘记密码**接口。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePasswordDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommonResponseDto"}}}}},"security":[{"x-authing-userpool-id":[]},{"bearer":[]}],"tags":["用户资料/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var res = await authenticationClient.UpdatePassword(new UpdatePasswordDto()\r\n {\r\n NewPassword = \"AUTHING_NEW_PASSWORD\",\r\n OldPassword = \"AUTHING_OLD_PASSWORD\",\r\n PasswordEncryptType = UpdatePasswordDto.passwordEncryptType.NONE\r\n });\r\n\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n reqDto := &dto.UpdatePasswordDto{\n\t\tNewPassword: \"xxxx\",\n\t\tOldPassword: \"xxxx\",\n\t}\n\trespDto := client.UpdatePassword(reqDto)\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.CommonResponseDto;\nimport cn.authing.sdk.java.dto.UpdatePasswordDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class UpdatePasswordTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n UpdatePasswordDto reqDto = new UpdatePasswordDto();\n reqDto.setOldPassword(\"123\");\n reqDto.setNewPassword(\"123\");\n CommonResponseDto response = client.updatePassword(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.updatePassword({\n newPassword: 'new-pass',\n oldPassword: 'old-pass',\n passwordEncryptType: Models.UpdatePasswordDto.passwordEncryptType.NONE\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"USER_ACCESS_TOKEN\");\n\n$data = $authenticationClient->updatePassword(array(\n \"newPassword\" => \"newPassw0rd\",\n \"oldPassword\" => \"oldPassw0rd\"\n));\nprint_r($data);\n"}}},"/api/v3/verify-update-email-request":{"post":{"operationId":"ProfileV3Controller_verifyUpdateEmailRequest","summary":"发起修改邮箱的验证请求","description":"终端用户自主修改邮箱时,需要提供相应的验证手段。此接口用于验证用户的修改邮箱请求是否合法。当前支持通过**邮箱验证码**的方式进行验证,你需要先调用发送邮件接口发送对应的邮件验证码。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyUpdateEmailRequestDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyUpdateEmailRequestRespDto"}}}}},"security":[{"x-authing-userpool-id":[]},{"bearer":[]}],"tags":["用户资料/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var res0 = await authenticationClient.SendEmail(new SendEmailDto()\r\n {\r\n Channel = SendEmailDto.channel.CHANNEL_UPDATE_EMAIL,\r\n Email = \"AUTHING_OLD_EMAIL\"\r\n });\r\n var res1 = await authenticationClient.SendEmail(new SendEmailDto()\r\n {\r\n Channel = SendEmailDto.channel.CHANNEL_UPDATE_EMAIL,\r\n Email = \"AUTHING_NEW_EMAIL\"\r\n });\r\n var res2 = await authenticationClient.VerifyUpdateEmailRequest(new VerifyUpdateEmailRequestDto()\r\n {\r\n EmailPasscodePayload = new UpdateEmailByEmailPassCodeDto()\r\n {\r\n NewEmail = \"AUTHING_NEW_EMAIL\",\r\n NewEmailPassCode = \"AUTHING_NEW_CODE\",\r\n OldEmail = \"AUTHING_OLD_EMAIL\",\r\n OldEmailPassCode = \"AUTHING_OLD_CODE\"\r\n },\r\n VerifyMethod = VerifyUpdateEmailRequestDto.verifyMethod.EMAIL_PASSCODE\r\n });\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n reqDto := &dto.VerifyUpdateEmailRequestDto{\n\t\tEmailPassCodePayload: dto.UpdateEmailByEmailPassCodeDto{\n\t\t\tNewEmail: \"test@example.com\",\n\t\t\tNewEmailPassCode: \"1234\",\n\t\t},\n\t\tVerifyMethod: \"EMAIL_PASSCODE\",\n\t}\n\trespDto := client.VerifyUpdateEmailRequest(reqDto)\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.UpdateEmailByEmailPassCodeDto;\nimport cn.authing.sdk.java.dto.VerifyUpdateEmailRequestDto;\nimport cn.authing.sdk.java.dto.VerifyUpdateEmailRequestRespDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class VerifyUpdateEmailRequestTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n VerifyUpdateEmailRequestDto reqDto = new VerifyUpdateEmailRequestDto();\n reqDto.setVerifyMethod(VerifyUpdateEmailRequestDto.VerifyMethod.EMAIL_PASSCODE);\n UpdateEmailByEmailPassCodeDto passCodeDto = new UpdateEmailByEmailPassCodeDto();\n passCodeDto.setNewEmail(\"123@qq.com\");\n passCodeDto.setNewEmailPassCode(\"123\");\n reqDto.setEmailPassCodePayload(passCodeDto);\n VerifyUpdateEmailRequestRespDto response = client.verifyUpdateEmailRequest(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.verifyUpdateEmailRequest({\n verifyMethod:\n Models.VerifyUpdateEmailRequestDto.verifyMethod.EMAIL_PASSCODE,\n emailPasscodePayload: {\n newEmail: 'new@example.com',\n newEmailPassCode: '123456',\n oldEmail: 'old@example.com',\n oldEmailPassCode: '123456'\n }\n });\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"ACCESS_TOKEN\");\n\n$data = $authenticationClient->verifyUpdateEmailRequest(array(\n \"verifyMethod\" => \"EMAIL_PASSCODE\",\n \"emailPassCodePayload\" => array(\n \"newEmail\" => \"test@example.com\",\n \"newEmailPassCode\" => \"1234\"\n )\n));\nprint_r($data);\n"}}},"/api/v3/update-email":{"post":{"operationId":"ProfileV3Controller_updateEmail","summary":"修改邮箱","description":"终端用户自主修改邮箱,需要提供相应的验证手段,见[发起修改邮箱的验证请求](#tag/用户资料/API%20列表/operation/ProfileV3Controller_verifyUpdateEmailRequest)。\n此参数需要提供一次性临时凭证 `updateEmailToken`,此数据需要从**发起修改邮箱的验证请求**接口获取。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEmailDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommonResponseDto"}}}}},"security":[{"x-authing-userpool-id":[]},{"bearer":[]}],"tags":["用户资料/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var res0 = await authenticationClient.SendEmail(new SendEmailDto()\r\n {\r\n Channel = SendEmailDto.channel.CHANNEL_UPDATE_EMAIL,\r\n Email = \"AUTHING_OLD_EMAIL\"\r\n });\r\n var res1 = await authenticationClient.SendEmail(new SendEmailDto()\r\n {\r\n Channel = SendEmailDto.channel.CHANNEL_UPDATE_EMAIL,\r\n Email = \"AUTHING_NEW_EMAIL\"\r\n });\r\n var res2 = await authenticationClient.VerifyUpdateEmailRequest(new VerifyUpdateEmailRequestDto()\r\n {\r\n EmailPasscodePayload = new UpdateEmailByEmailPassCodeDto()\r\n {\r\n NewEmail = \"AUTHING_NEW_EMAIL\",\r\n NewEmailPassCode = \"AUTHING_NEW_CODE\",\r\n OldEmail = \"AUTHING_OLD_EMAIL\",\r\n OldEmailPassCode = \"AUTHING_OLD_CODE\"\r\n },\r\n VerifyMethod = VerifyUpdateEmailRequestDto.verifyMethod.EMAIL_PASSCODE\r\n });\r\n var res3 = await authenticationClient.UpdateEmail(new UpdateEmailDto()\r\n {\r\n UpdateEmailToken = res2.Data.UpdateEmailToken\r\n });\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n // 需要替换成 verifyUpdateEmailRequest 接口返回的真实 updateEmailToken\n\treqDto := &dto.UpdateEmailDto{UpdateEmailToken: \"xxxx\"}\n\trespDto := client.UpdateEmail(reqDto)\n\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.CommonResponseDto;\nimport cn.authing.sdk.java.dto.UpdateEmailDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class UpdateEmailTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n UpdateEmailDto reqDto = new UpdateEmailDto();\n // 用于临时修改邮箱的 token,可从发起修改邮箱的验证请求接口获取。\n reqDto.setUpdateEmailToken(\"xxx\");\n CommonResponseDto response = client.updateEmail(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.updateEmail({\n // 用于临时修改邮箱的 token,可从发起修改邮箱的验证请求接口获取。\n updateEmailToken: 'xxxx'\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"ACCESS_TOKEN\");\n\n$data = $authenticationClient->updateEmail(array(\n // 需要替换成 verifyUpdateEmailRequest 接口返回的真实 updateEmailToken\n \"updateEmailToken\" => \"xxxxx\"\n));\nprint_r($data);\n"}}},"/api/v3/verify-update-phone-request":{"post":{"operationId":"ProfileV3Controller_verifyUpdatePhoneRequest","summary":"发起修改手机号的验证请求","description":"终端用户自主修改手机号时,需要提供相应的验证手段。此接口用于验证用户的修改手机号请求是否合法。当前支持通过**短信验证码**的方式进行验证,你需要先调用发送短信接口发送对应的短信验证码。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyUpdatePhoneRequestDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyUpdatePhoneRequestRespDto"}}}}},"security":[{"x-authing-userpool-id":[]},{"bearer":[]}],"tags":["用户资料/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var res0 = await authenticationClient.SendSms(new SendSMSDto()\r\n {\r\n Channel = SendSMSDto.channel.CHANNEL_UNBIND_PHONE,\r\n PhoneNumber = \"AUTHING_NEW_PHONE\"\r\n });\r\n var res1 = await authenticationClient.SendSms(new SendSMSDto()\r\n {\r\n Channel = SendSMSDto.channel.CHANNEL_UNBIND_PHONE,\r\n PhoneNumber = \"AUTHING_OLD_PHONE\"\r\n });\r\n var res2 = await authenticationClient.VerifyUpdatePhoneRequest(new VerifyUpdatePhoneRequestDto()\r\n {\r\n PhonePassCodePayload = new UpdatePhoneByPhonePassCodeDto()\r\n {\r\n NewPhoneNumber = \"AUTHING_NEW_PHONE\",\r\n NewPhonePassCode = \"AUTHING_NEW_CODE\",\r\n OldPhoneNumber = \"AUTHING_OLD_PHONE\",\r\n OldPhonePassCode = \"AUTHING_OLD_CODE\"\r\n },\r\n VerifyMethod = VerifyUpdatePhoneRequestDto.verifyMethod.PHONE_PASSCODE\r\n });\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n reqDto := &dto.VerifyUpdatePhoneRequestDto{\n\t\tPhonePassCodePayload: dto.UpdatePhoneByPhonePassCodeDto{\n\t\t\tNewPhoneNumber: \"188xxxx8888\",\n\t\t\tNewPhonePassCode: \"1234\",\n\t\t},\n\t\tVerifyMethod: \"PHONE_PASSCODE\",\n\t}\n\trespDto := client.VerifyUpdatePhoneRequest(reqDto)\n\tfmt.Println(respDto)\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.verifyUpdatePhoneRequest({\n verifyMethod:\n Models.VerifyUpdatePhoneRequestDto.verifyMethod.PHONE_PASSCODE,\n phonePassCodePayload: {\n newPhoneNumber: '188xxxx9999',\n newPhonePassCode: '123456',\n newPhoneCountryCode: '+86',\n oldPhoneNumber: '188xxxx8888',\n oldPhonePassCode: '123456',\n oldPhoneCountryCode: '+86'\n }\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"ACCESS_TOKEN\");\n\n$data = $authenticationClient->verifyUpdatePhoneRequest(array(\n \"verifyMethod\" => \"PHONE_PASSCODE\",\n \"phonePassCodePayload\" => array(\n \"newPhoneNumber\" => \"188xxxx8888\",\n \"newPhonePassCode\" => \"1234\"\n )\n));\nprint_r($data);\n"}}},"/api/v3/update-phone":{"post":{"operationId":"ProfileV3Controller_updatePhone","summary":"修改手机号","description":"终端用户自主修改手机号,需要提供相应的验证手段,见[发起修改手机号的验证请求](#tag/用户资料/API%20列表/operation/ProfileV3Controller_updatePhoneVerification)。\n此参数需要提供一次性临时凭证 `updatePhoneToken`,此数据需要从**发起修改手机号的验证请求**接口获取。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePhoneDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommonResponseDto"}}}}},"security":[{"x-authing-userpool-id":[]},{"bearer":[]}],"tags":["用户资料/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var res0 = await authenticationClient.SendSms(new SendSMSDto()\r\n {\r\n Channel = SendSMSDto.channel.CHANNEL_UNBIND_PHONE,\r\n PhoneNumber = \"AUTHING_NEW_PHONE\"\r\n });\r\n var res1 = await authenticationClient.SendSms(new SendSMSDto()\r\n {\r\n Channel = SendSMSDto.channel.CHANNEL_UNBIND_PHONE,\r\n PhoneNumber = \"AUTHING_OLD_PHONE\"\r\n });\r\n var res2 = await authenticationClient.VerifyUpdatePhoneRequest(new VerifyUpdatePhoneRequestDto()\r\n {\r\n PhonePassCodePayload = new UpdatePhoneByPhonePassCodeDto()\r\n {\r\n NewPhoneNumber = \"AUTHING_NEW_PHONE\",\r\n NewPhonePassCode = \"AUTHING_NEW_CODE\",\r\n OldPhoneNumber = \"AUTHING_OLD_PHONE\",\r\n OldPhonePassCode = \"AUTHING_OLD_CODE\"\r\n },\r\n VerifyMethod = VerifyUpdatePhoneRequestDto.verifyMethod.PHONE_PASSCODE\r\n });\r\n var res3 = await authenticationClient.UpdatePhone(new UpdatePhoneDto()\r\n {\r\n UpdatePhoneToken = res2.Data.UpdatePhoneToken\r\n });\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n // 需要替换成 verifyUpdatePhoneRequest 接口返回的真实 updatePhoneToken\n\treqDto := &dto.UpdatePhoneDto{UpdatePhoneToken: \"xxx\"}\n\trespDto := client.UpdatePhone(reqDto)\n\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.CommonResponseDto;\nimport cn.authing.sdk.java.dto.UpdatePhoneDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class UpdatePhoneTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n UpdatePhoneDto reqDto = new UpdatePhoneDto();\n // 用于临时修改手机号的 token,可从发起修改手机号的验证请求接口获取。\n reqDto.setUpdatePhoneToken(\"xxx\");\n CommonResponseDto response = client.updatePhone(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.updatePhone({\n // 用于临时修改手机号的 token,可从发起修改手机号的验证请求接口获取。\n updatePhoneToken: 'xxxx'\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"ACCESS_TOKEN\");\n\n$data = $authenticationClient->updatePhone(array(\n // 需要替换成 verifyUpdatePhoneRequest 接口返回的真实 updatePhoneToken\n \"updatePhoneToken\" => \"xxxxxx\"\n));\nprint_r($data);\n"}}},"/api/v3/verify-reset-password-request":{"post":{"operationId":"ProfileV3Controller_verifyResetPasswordRequest","summary":"发起忘记密码请求","description":"当用户忘记密码时,可以通过此端点找回密码。用户需要使用相关验证手段进行验证,目前支持**邮箱验证码**和**手机号验证码**两种验证手段。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyResetPasswordRequestDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordResetVerifyResp"}}}}},"security":[{"x-authing-userpool-id":[]},{"bearer":[]}],"tags":["用户资料/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var res = await authenticationClient.SendEmail(new SendEmailDto()\r\n {\r\n Channel = SendEmailDto.channel.CHANNEL_RESET_PASSWORD,\r\n Email = \"AUTHING_EMAIL\"\r\n });\r\n var res2 = await authenticationClient.VerifyResetPasswordRequest(new VerifyResetPasswordRequestDto\r\n {\r\n VerifyMethod = VerifyResetPasswordRequestDto.verifyMethod.EMAIL_PASSCODE,\r\n EmailPassCodePayload = new ResetPasswordByEmailPassCodeDto()\r\n {\r\n Email = \"AUTHING_EMAIL\",\r\n PassCode = \"AUTHING_CODE\"\r\n }\r\n });\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n reqDto := &dto.VerifyResetPasswordRequestDto{\n\t\tVerifyMethod: \"EMAIL_PASSCODE\",\n\t\tEmailPassCodePayload: dto.ResetPasswordByEmailPassCodeDto{\n\t\t\tEmail: \"test@example.com\",\n\t\t\tPassCode: \"1234\",\n\t\t},\n\t}\n\trespDto := client.VerifyResetPasswordRequest(reqDto)\n\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.PasswordResetVerifyResp;\nimport cn.authing.sdk.java.dto.ResetPasswordByEmailPassCodeDto;\nimport cn.authing.sdk.java.dto.VerifyResetPasswordRequestDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class VerifyResetPasswordRequestTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n VerifyResetPasswordRequestDto reqDto = new VerifyResetPasswordRequestDto();\n reqDto.setVerifyMethod(VerifyResetPasswordRequestDto.VerifyMethod.EMAIL_PASSCODE);\n ResetPasswordByEmailPassCodeDto passCodeDto = new ResetPasswordByEmailPassCodeDto();\n // 邮箱验证码,一个短信验证码只能使用一次,默认有效时间为 5 分钟。你需要通过发送邮件接口获取。\n passCodeDto.setPassCode(\"xxx\");\n passCodeDto.setEmail(\"123@qq.com\");\n reqDto.setEmailPassCodePayload(passCodeDto);\n PasswordResetVerifyResp response = client.verifyResetPasswordRequest(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n const result = await authenticationClient.verifyResetPasswordRequest({\n verifyMethod:\n Models.VerifyResetPasswordRequestDto.verifyMethod.PHONE_PASSCODE,\n phonePassCodePayload: {\n phoneNumber: '188xxxx8888',\n passCode: '123456',\n phoneCountryCode: '+86'\n }\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"ACCESS_TOKEN\");\n\n$data = $authenticationClient->verifyResetPasswordRequest(array(\n \"verifyMethod\" => \"EMAIL_PASSCODE\",\n \"emailPassCodePayload\" => array(\n \"email\" => \"test@example.com\",\n \"passCode\" => \"1234\"\n )\n));\nprint_r($data);\n"}}},"/api/v3/reset-password":{"post":{"operationId":"ProfileV3Controller_resetPassword","summary":"忘记密码","description":"此端点用于用户忘记密码之后,通过**手机号验证码**或者**邮箱验证码**的方式重置密码。此接口需要提供用于重置密码的临时凭证 `passwordResetToken`,此参数需要通过**发起忘记密码请求**接口获取。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IsSuccessRespDto"}}}}},"security":[{"x-authing-userpool-id":[]},{"bearer":[]}],"tags":["用户资料/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var res = await authenticationClient.SendEmail(new SendEmailDto()\r\n {\r\n Channel = SendEmailDto.channel.CHANNEL_RESET_PASSWORD,\r\n Email = \"AUTHING_EMAIL\"\r\n });\r\n var res2 = await authenticationClient.VerifyResetPasswordRequest(new VerifyResetPasswordRequestDto\r\n {\r\n VerifyMethod = VerifyResetPasswordRequestDto.verifyMethod.EMAIL_PASSCODE,\r\n EmailPassCodePayload = new ResetPasswordByEmailPassCodeDto()\r\n {\r\n Email = \"AUTHING_EMAIL\",\r\n PassCode = \"AUTHING_CODE\"\r\n }\r\n });\r\n var res3 = await authenticationClient.ResetPassword(new ResetPasswordDto\r\n {\r\n Password = \"AUTHING_NEW_PASSWORD\",\r\n PasswordResetToken = res2.Data.PasswordResetToken,\r\n PasswordEncryptType = ResetPasswordDto.passwordEncryptType.NONE,\r\n });\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n reqDto := &dto.ResetPasswordDto{\n\t\tPassword: \"xxxx\",\n\t\t// 需要替换成 verifyResetPasswordRequest 接口返回的真实 PasswordResetToken\n\t\tPasswordResetToken: \"xxxx\",\n\t}\n\trespDto := client.ResetPassword(reqDto)\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.IsSuccessRespDto;\nimport cn.authing.sdk.java.dto.ResetPasswordDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class ResetPasswordTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n ResetPasswordDto reqDto = new ResetPasswordDto();\n reqDto.setPassword(\"123\");\n // 此接口需要提供用于重置密码的临时凭证 passwordResetToken, 此参数需要通过发起忘记密码请求接口获取。\n reqDto.setPasswordResetToken(\"xxx\");\n IsSuccessRespDto response = client.resetPassword(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n const result = await authenticationClient.resetPassword({\n // 重置密码的 token\n passwordResetToken: 'xxxxx',\n password: 'passw0rd',\n passwordEncryptType: Models.ResetPasswordDto.passwordEncryptType.NONE\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"ACCESS_TOKEN\");\n\n$data = $authenticationClient->resetPassword(array(\n // 需要替换成 verifyResetPasswordRequest 接口返回的真实 passwordResetToken\n \"passwordResetToken\" => \"xxxx\",\n \"password\" => \"passw0rd\"\n));\nprint_r($data);\n"}}},"/api/v3/verify-delete-account-request":{"post":{"operationId":"ProfileV3Controller_verifyDeleteAccountRequest","summary":"发起注销账号请求","description":"当用户希望注销账号时,需提供相应凭证,当前支持**使用邮箱验证码**、使用**手机验证码**、**使用密码**三种验证方式。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyDeleteAccountRequestDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyDeleteAccountRequestRespDto"}}}}},"security":[{"x-authing-userpool-id":[]},{"bearer":[]}],"tags":["用户资料/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var res1 = await authenticationClient.VeirfyDeleteAccountRequest(new VerifyDeleteAccountRequestDto()\r\n {\r\n VerifyMethod = VerifyDeleteAccountRequestDto.verifyMethod.PASSWORD,\r\n PasswordPayload = new DeleteAccountByPasswordDto\r\n {\r\n PasswordEncryptType = DeleteAccountByPasswordDto.passwordEncryptType.NONE,\r\n Password = \"AUTHING_PASSWORD\"\r\n }\r\n });\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n reqDto := &dto.VerifyDeleteAccountRequestDto{\n\t\tVerifyMethod: \"PHONE_PASSCODE\",\n\t\tPhonePassCodePayload: dto.DeleteAccountByPhonePassCodeDto{\n\t\t\tPhoneNumber: \"188xxxx8888\",\n\t\t\tPassCode: \"1234\",\n\t\t},\n\t}\n\trespDto := client.VerifyDeleteAccountRequest(reqDto)\n\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.DeleteAccountByEmailPassCodeDto;\nimport cn.authing.sdk.java.dto.VerifyDeleteAccountRequestDto;\nimport cn.authing.sdk.java.dto.VerifyDeleteAccountRequestRespDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\n\npublic class VerifyDeleteAccountRequestTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n VerifyDeleteAccountRequestDto reqDto = new VerifyDeleteAccountRequestDto();\n reqDto.setVerifyMethod(VerifyDeleteAccountRequestDto.VerifyMethod.EMAIL_PASSCODE);\n DeleteAccountByEmailPassCodeDto passCodeDto = new DeleteAccountByEmailPassCodeDto();\n passCodeDto.setEmail(\"123@qq.com\");\n // 邮箱验证码,一个短信验证码只能使用一次,默认有效时间为 5 分钟。你需要通过发送邮件接口获取。\n passCodeDto.setPassCode(\"xxx\");\n reqDto.setEmailPassCodePayload(passCodeDto);\n VerifyDeleteAccountRequestRespDto response = client.verifyDeleteAccountRequest(reqDto);\n System.out.println(JsonUtils.serialize(response));\n }\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.verifyDeleteAccountRequest({\n verifyMethod: Models.VerifyDeleteAccountRequestDto.verifyMethod.PHONE_PASSCODE,\n phonePassCodePayload: {\n phoneNumber: '188xxxx8888',\n passCode: '123456',\n phoneCountryCode: '+86'\n }\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"ACCESS_TOKEN\");\n\n$data = $authenticationClient->verifyDeleteAccountRequest(array(\n \"verifyMethod\" => \"PHONE_PASSCODE\",\n \"phonePassCodePayload\" => array(\n \"phoneNumber\" => \"188xxxx8888\",\n \"passCode\" => \"1234\"\n )\n));\nprint_r($data);\n"}}},"/api/v3/delete-account":{"post":{"operationId":"ProfileV3Controller_deleteAccount","summary":"注销账户","description":"此端点用于用户自主注销账号,需要提供用于注销账号的临时凭证 deleteAccountToken,此参数需要通过**发起注销账号请求**接口获取。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAccounDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IsSuccessRespDto"}}}}},"security":[{"x-authing-userpool-id":[]},{"bearer":[]}],"tags":["用户资料/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n\r\n var res1 = await authenticationClient.VeirfyDeleteAccountRequest(new VerifyDeleteAccountRequestDto()\r\n {\r\n VerifyMethod = VerifyDeleteAccountRequestDto.verifyMethod.PASSWORD,\r\n PasswordPayload = new DeleteAccountByPasswordDto\r\n {\r\n PasswordEncryptType = DeleteAccountByPasswordDto.passwordEncryptType.NONE,\r\n Password = \"AUTHING_PASSWORD\"\r\n }\r\n });\r\n var res2 = await authenticationClient.DeleteAccount(new DeleteAccounDto\r\n {\r\n DeleteAccountToken = res1.Data.DeleteAccountToken\r\n });\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n reqDto := &dto.DeleteAccounDto{DeleteAccountToken: \"xxxx\"}\n respDto := client.DeleteAccount(reqDto)\n\tfmt.Println(respDto)\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.deleteAccount({\n // 注销账户的 token\n deleteAccountToken: 'xxxx'\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n// 使用用户的 access_token 初始化 $authenticationClient,access_token 可以通过登录接口获取\n$authenticationClient->setAccessToken(\"ACCESS_TOKEN\");\n\n$data = $authenticationClient->deleteAccount(array(\n // 需要替换成 verifyDeleteAccountRequest 接口返回的真实 updateEmailToken\n \"deleteAccountToken\" => \"xxxxxxxx\",\n));\nprint_r($data);\n"}}},"/api/v3/get-user-select-login-public-accounts":{"get":{"operationId":"ProfileV3Controller_listPublicAccountsForSwitchLoggedIn","summary":"查询当前登录用户可切换登录的公共账号列表","description":"此端点用于查询当前登录用户可切换登录的公共账号列表,如果没有可切换登录的公共账号,则返回空数组。","parameters":[{"name":"withOriginUser","required":false,"in":"query","description":"是否包含当前个人用户基本信息","example":false,"schema":{"default":false,"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetPublicAccountDataRespDto"}}}}},"security":[{"x-authing-userpool-id":[]},{"bearer":[]}],"tags":["用户资料/API 列表"]}},"/api/v3/system":{"get":{"operationId":"PublicAPIV3Controller_getSystemInfo","summary":"获取服务器公开信息","description":"可端点可获取服务器的公开信息,如 RSA256 公钥、SM2 公钥、Authing 服务版本号等。","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemInfoResp"}}}}},"security":[{"bearer":[]}],"tags":["公开信息端点/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n \r\n var res = await authenticationClient.GetSystemInfo();\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t respDto := client.GetSystemInfo()\n\tfmt.Println(respDto)\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n const result = await authenticationClient.getSystemInfo();\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n$data = $authenticationClient->getSystemInfo();\nprint_r($data);\n"}}},"/api/v3/get-country-list":{"get":{"operationId":"PublicAPIV3Controller_getCountryList","summary":"获取国家列表","description":"动态获取国家列表,可以用于前端登录页面国家选择和国际短信输入框选择,以减少前端静态资源体积。","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetCountryListRespDto"}}}}},"security":[{"bearer":[]}],"tags":["公开信息端点/API 列表"],"x-authing-code-samples":{"csharp":"using System.Threading.Tasks;\r\nusing Authing.CSharp.SDK.Models;\r\nusing Authing.CSharp.SDK.Models.Authentication;\r\nusing Authing.CSharp.SDK.Services;\r\n\r\nnamespace ConsoleApplication\r\n{\r\n public class Program\r\n {\r\n static void Main(string[] args)\r\n {\r\n MainAsync().GetAwaiter().GetResult();\r\n }\r\n\r\n private static async Task MainAsync()\r\n {\r\n // 设置初始化参数\r\n AuthenticationClientInitOptions clientOptions = new AuthenticationClientInitOptions\r\n {\r\n AppId = \"AUTHING_APP_ID\",// Authing 应用 ID\r\n AppSecret = \"AUTHING_APP_SECRET\",// Authing 应用密钥\r\n AppHost = \"AUTHING_APP_DOMAIN\", // Authing 应用域名,如 https://example.authing.cn\r\n RedirectUri = \"AUTHING_APP_REDIRECT_URI\",// Authing 应用配置的登录回调地址\r\n };\r\n\r\n // 初始化 AuthenticationClient\r\n AuthenticationClient authenticationClient = new AuthenticationClient(clientOptions);\r\n\r\n //登录临时用户\r\n LoginTokenRespDto loginTokenRespDto = await authenticationClient.SignInByAccountPassword(\"AUTHING_USERNAME\", \"AUTHING_USER_PASSWORD\");\r\n authenticationClient.setAccessToken(loginTokenRespDto.Data.Access_token);\r\n \r\n var res = await authenticationClient.GetCountryList();\r\n }\r\n }\r\n}","go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t respDto := client.GetCountryList()\n\n\tfmt.Println(respDto)\n}\n","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n const result = await authenticationClient.getCountryList();\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n","php":"<?php\n\nuse Authing\\AuthenticationClient;\n\n// 需要替换成你的 Authing 应用 ID\n$AUTHING_APP_ID = \"AUTHING_APP_ID\";\n// 需要替换成你的 Authing 应用密钥\n$AUTHING_APP_SECRET = \"AUTHING_APP_SECRET\";\n// 需要替换成你的 Authing 应用域名\n$AUTHING_APP_HOST = \"AUTHING_APP_HOST\";\n\n// 初始化 AuthenticationClient\n$authenticationClient = new Authing\\AuthenticationClient(\n array(\n \"appId\" => $AUTHING_APP_ID,\n \"appSecret\" => $AUTHING_APP_SECRET,\n \"appHost\" => $AUTHING_APP_HOST,\n )\n);\n\n$data = $authenticationClient->getCountryList();\nprint_r($data);\n"}}},"/api/v2/upload":{"post":{"operationId":"ApiV3UploadController_upload","x-authing-hidden-from-sdk":true,"summary":"文件上传","description":"","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadRespDto"}}}}},"tags":["文件上传/API 列表"]}},"/api/v3/check-permission-string-resource":{"post":{"operationId":"UserDataPermissionV3Controller_checkPermissionByStringResource","summary":"字符串类型资源鉴权","description":"字符串类型资源鉴权,支持用户对一个或者多个字符串资源进行权限判断","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckPermissionStringResourceDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckResourcePermissionsRespDto"}}}}},"security":[{"bearer":[]}],"tags":["鉴权/API 列表"],"x-authing-code-samples":{"go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n reqDto := &dto.CheckPermissionStringResourceDto{\n action: \"get\",\n\t\t resources: []string{\"stringExampleResourceCode1\", \"stringExampleResourceCode2\"},\n }\n respDto := client.checkPermissionByStringResource(reqDto)\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.BindEmailDto;\nimport cn.authing.sdk.java.dto.CheckPermissionArrayResourceDto;\nimport cn.authing.sdk.java.dto.CheckPermissionStringResourceDto;\nimport cn.authing.sdk.java.dto.CheckResourcePermissionsRespDto;\nimport cn.authing.sdk.java.dto.CommonResponseDto;\nimport cn.authing.sdk.java.dto.LoginTokenRespDto;\nimport cn.authing.sdk.java.dto.SignInOptionsDto;\nimport cn.authing.sdk.java.dto.SignUpOptionsDto;\nimport cn.authing.sdk.java.dto.SignUpProfileDto;\nimport cn.authing.sdk.java.dto.UserSingleRespDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\nimport java.util.ArrayList;\n\npublic class CheckPermissionStringResourceTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n CheckPermissionStringResourceDto reqDto = new CheckPermissionStringResourceDto();\n ArrayList<String> list = new ArrayList<>();\n list.add(\"stringResourceCode\");\n list.add(\"stringResourceCode1\");\n reqDto.setResources(list);\n reqDto.setAction(\"get\");\n CheckResourcePermissionsRespDto checkResourcePermissionsRespDto = client\n .checkPermissionByStringResource(reqDto);\n System.out.println(JsonUtils.serialize(checkResourcePermissionsRespDto));\n }\n}","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.checkPermissionByStringResource({\n action: 'get',\n resources: ['stringExampleResourceCode1', 'stringExampleResourceCode2']\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n"}}},"/api/v3/check-permission-array-resource":{"post":{"operationId":"UserDataPermissionV3Controller_checkPermissionByArrayResource","summary":"数组类型资源鉴权","description":"数组类型资源鉴权,支持用户对一个或者多个数组资源进行权限判断","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckPermissionArrayResourceDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckResourcePermissionsRespDto"}}}}},"security":[{"bearer":[]}],"tags":["鉴权/API 列表"],"x-authing-code-samples":{"go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n reqDto := &dto.CheckPermissionArrayResourceDto{\n action: \"get\",\n\t\t resources: []string{\"arrayExampleResourceCode1\", \"arrayExampleResourceCode2\"},\n }\n respDto := client.checkPermissionByArrayResource(reqDto)\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.BindEmailDto;\nimport cn.authing.sdk.java.dto.CheckPermissionArrayResourceDto;\nimport cn.authing.sdk.java.dto.CheckPermissionStringResourceDto;\nimport cn.authing.sdk.java.dto.CheckResourcePermissionsRespDto;\nimport cn.authing.sdk.java.dto.CommonResponseDto;\nimport cn.authing.sdk.java.dto.LoginTokenRespDto;\nimport cn.authing.sdk.java.dto.SignInOptionsDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\nimport java.util.ArrayList;\n\npublic class CheckPermissionArrayResourceTest {\n\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n CheckPermissionArrayResourceDto reqDto = new CheckPermissionArrayResourceDto();\n ArrayList<String> list = new ArrayList<>();\n list.add(\"arrayResourceCode\");\n list.add(\"arrayResourceCode1\");\n reqDto.setResources(list);\n reqDto.setAction(\"get\");\n CheckResourcePermissionsRespDto checkResourcePermissionsRespDto = client\n .checkPermissionByArrayResource(reqDto);\n System.out.println(JsonUtils.serialize(checkResourcePermissionsRespDto));\n }\n}","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.checkPermissionByArrayResource({\n action: 'get',\n resources: ['arrayExampleResourceCode1', 'arrayExampleResourceCode2']\n });\n\n\n console.log(JSON.stringify(result, null, 2));\n})();\n"}}},"/api/v3/check-permission-tree-resource":{"post":{"operationId":"UserDataPermissionV3Controller_checkPermissionByTreeResource","summary":"树类型资源鉴权","description":"树类型资源鉴权,支持用户对一个或者多个树资源进行权限判断","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckPermissionTreeResourceDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckResourcePermissionsRespDto"}}}}},"security":[{"bearer":[]}],"tags":["鉴权/API 列表"],"x-authing-code-samples":{"go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n\n reqDto := &dto.CheckPermissionTreeResourceDto{\n action: \"get\",\n\t\t resources: []string{\"treeExampleResourceCode/childrenCode\", \"treeExampleResourceCode/childrenCode/treeExampleResourceCode/childrenCode1\"},\n }\n respDto := client.checkPermissionByTreeResource(reqDto)\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.BindEmailDto;\nimport cn.authing.sdk.java.dto.CheckPermissionStringResourceDto;\nimport cn.authing.sdk.java.dto.CheckPermissionTreeResourceDto;\nimport cn.authing.sdk.java.dto.CheckResourcePermissionsRespDto;\nimport cn.authing.sdk.java.dto.CommonResponseDto;\nimport cn.authing.sdk.java.dto.LoginTokenRespDto;\nimport cn.authing.sdk.java.dto.SignInOptionsDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\nimport java.util.ArrayList;\n\npublic class CheckPermissionTreeResourceTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n CheckPermissionTreeResourceDto reqDto = new CheckPermissionTreeResourceDto();\n ArrayList<String> list = new ArrayList<>();\n\n list.add(\"/treeExampleResourceCode/children1Code\");\n list.add(\"/treeExampleResourceCode/children1Code/children2Code\");\n reqDto.setResources(list);\n reqDto.setAction(\"get\");\n CheckResourcePermissionsRespDto checkResourcePermissionsRespDto = client\n .checkPermissionByTreeResource(reqDto);\n System.out.println(JsonUtils.serialize(checkResourcePermissionsRespDto));\n }\n}","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.checkPermissionByTreeResource({\n action: 'get',\n resources: ['treeExampleResourceCod/childrenCode', 'treeExampleResourceCod/childrenCode/childrenCode1']\n });\n\n console.log(JSON.stringify(result, null, 2));\n})();\n"}}},"/api/v3/get-user-auth-resource-list":{"get":{"operationId":"UserDataPermissionV3Controller_GetUserAuthorizedResourcesList","summary":"获取用户在登录应用下被授权资源列表","description":"获取用户指定资源权限列表,用户获取在某个应用下所拥有的资源列表。","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetUserAuthResourceListRespDto"}}}}},"security":[{"bearer":[]}],"tags":["鉴权/API 列表"],"x-authing-code-samples":{"go":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Authing/authing-golang-sdk/v3/authentication\"\n\t\"github.com/Authing/authing-golang-sdk/v3/dto\"\n)\n\nfunc main() {\n\toptions := &authentication.AuthenticationClientOptions{\n // 需要替换成你的 Authing 应用 ID\n\t\tAppId: \"AUTHING_APP_ID\",\n // 需要替换成你的 Authing 应用密钥\n\t\tAppSecret: \"AUTHING_APP_SECRET\",\n // 需要替换成你的 Authing 应用域名\n\t\tAppHost: \"AUTHING_APP_HOST\",\n // 需要替换成你的 Authing 应用回调地址\n\t\tRedirectUri: \"AUTHING_APP_REDIRECT_URI\",\n\t}\n\tclient, err := authentication.NewAuthenticationClient(options)\n\tif err != nil {\n\t\t// The exception needs to be handled by the developer.\n\t}\n\t // 使用用户的 access_token 初始化 AuthenticationClient,access_token 可以通过登录接口获取\n client.SetAccessToken(\"USER_ACCESS_TOKEN\")\n respDto := client.getUserAuthorizedResourcesList()\n\tfmt.Println(respDto)\n}\n","java":"package test.authentication;\n\nimport cn.authing.sdk.java.client.AuthenticationClient;\nimport cn.authing.sdk.java.dto.CheckPermissionArrayResourceDto;\nimport cn.authing.sdk.java.dto.CheckResourcePermissionsRespDto;\nimport cn.authing.sdk.java.dto.GetUserAuthResourceListRespDto;\nimport cn.authing.sdk.java.dto.LoginTokenRespDto;\nimport cn.authing.sdk.java.dto.SignInOptionsDto;\nimport cn.authing.sdk.java.model.AuthenticationClientOptions;\nimport cn.authing.sdk.java.util.JsonUtils;\nimport java.util.ArrayList;\n\npublic class GetUserAuthResourceListTest {\n // 需要替换成你的 Authing App ID\n private static final String APP_ID = \"AUTHING_APP_ID\";\n // 需要替换成你的 Authing App Secret\n private static final String APP_SECRET = \"AUTHING_APP_SECRET\";\n // 需要替换成你的 Authing App Host\n private static final String APP_HOST = \"AUTHING_APP_HOST\";\n // 需要替换成你的 Authing Access Token\n private static final String ACCESS_TOKEN = \"AUTHING_ACCESS_TOKEN\";\n\n public static void main(String[] args) throws Throwable {\n\n AuthenticationClientOptions clientOptions = new AuthenticationClientOptions();\n clientOptions.setAppId(APP_ID);\n clientOptions.setAppSecret(APP_SECRET);\n clientOptions.setAppHost(APP_HOST);\n clientOptions.setAccessToken(ACCESS_TOKEN);\n\n AuthenticationClient client = new AuthenticationClient(clientOptions);\n\n GetUserAuthResourceListRespDto userAuthorizedResourcesList = client\n .getUserAuthorizedResourcesList();\n System.out.println(JsonUtils.serialize(userAuthorizedResourcesList));\n }\n}","node":"import { AuthenticationClient, Models } from 'authing-node-sdk';\n\nconst authenticationClient = new AuthenticationClient({\n // 需要替换成你的 Authing AppId、 Secret 和 Host\n appId: 'AUTHING_APP_ID',\n appSecret: 'AUTHING_APP_SECRET',\n appHost: 'AUTHING_APP_HOST'\n});\n\n(async () => {\n\n // 请先调用登录接口获取 access_token,并调用 setAccessToken 方法设置 access_token\n authenticationClient.setAccessToken(\"REPLACE_ME_WITH_REAL_ACCESS_TOKEN\");\n\n const result = await authenticationClient.getUserAuthorizedResourcesList();\n\n console.log(JSON.stringify(result, null, 2));\n})();\n"}}},"/api/v3/get-user-auth-resource-permission-list":{"post":{"operationId":"UserDataPermissionV3Controller_getUserAuthResourcePermissionList","summary":"获取用户指定资源权限列表","description":"获取用户指定资源的权限列表,用户获取某个应用下指定资源的权限列表。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetUserAuthResourcePermissionListDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetUserAuthResourcePermissionListRespDto"}}}}},"security":[{"bearer":[]}],"tags":["鉴权/API 列表"]}},"/api/v3/get-user-auth-resource-struct":{"post":{"operationId":"UserDataPermissionV3Controller_getUserAuthResourceStruct","summary":"获取用户授权资源的结构列表","description":"获取用户授权的资源列表,用户获取某个应用下的某个资源所授权的结构列表,通过不同的资源类型返回对应资源的授权列表。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetUserAuthResourceStructDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetUserAuthResourceStructRespDto"}}}}},"security":[{"bearer":[]}],"tags":["鉴权/API 列表"]}},"/api/v3/webauthn/authentication":{"get":{"operationId":"WebAuthnSignInV3Controller_initAuthenticationOptions","summary":"获取 WebAuthn 认证请求初始化参数","description":"获取 WebAuthn 认证请求初始化参数","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAuthenticationOptionsRespDto"}}}}},"security":[{"x-authing-app-id":[]}],"tags":["登录/API 列表"]},"post":{"operationId":"WebAuthnSignInV3Controller_verifyAuthentication","summary":"验证 WebAuthn 认证请求凭证","description":"验证 WebAuthn 认证请求凭证","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyAuthenticationDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyAuthenticationResultRespDto"}}}}},"security":[{"x-authing-app-id":[]}],"tags":["登录/API 列表"]}},"/api/v3/webauthn/registration":{"get":{"operationId":"WebAuthnSignUpV3Controller_initRegisterOptions","summary":"获取 webauthn 凭证创建初始化参数","description":"获取 webauthn 凭证创建初始化参数。**此接口要求具备用户的登录态**","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetRegistrationOptionsRespDto"}}}}},"security":[{"x-authing-app-id":[]},{"bearer":[]}],"tags":["用户资料/API 列表"]},"post":{"operationId":"WebAuthnSignUpV3Controller_verifyRegister","summary":"验证 webauthn 绑定注册认证器凭证","description":"验证 webauthn 绑定注册认证器凭证","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyRegistrationDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyRegistrationResultRespDto"}}}}},"security":[{"x-authing-app-id":[]},{"bearer":[]}],"tags":["用户资料/API 列表"]}},"/api/v3/webauthn/page-authenticator-device":{"post":{"operationId":"AuthenticatorDeviceV3Controller_listCredentialsByPage","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDeviceCredentialDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListWebAuthnAuthenticatorDeviceDataDto"}}}}},"security":[{"x-authing-app-id":[]},{"bearer":[]}]}},"/api/v3/webauthn/check-valid-credentials-by-credIds":{"post":{"operationId":"AuthenticatorDeviceV3Controller_checkValidCredentialsByCredIds","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckDeviceCredentialIdDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebAuthnCheckValidCredentialsByCredIdsRespDto"}}}}},"security":[{"x-authing-app-id":[]},{"bearer":[]}]}},"/api/v3/webauthn/remove-credentials-by-authenticator-code":{"post":{"operationId":"AuthenticatorDeviceV3Controller_RemoveAllCredentials","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveDeviceCredentialDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IsSuccessRespDto"}}}}},"security":[{"x-authing-app-id":[]},{"bearer":[]}]}},"/api/v3/webauthn/remove-credential/{credentialID}":{"post":{"operationId":"AuthenticatorDeviceV3Controller_RemoveCredential","parameters":[{"name":"credentialID","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebAuthnRemoveCredentialDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IsSuccessRespDto"}}}}},"security":[{"x-authing-app-id":[]},{"bearer":[]}]}},"/api/v3/mydevices/list":{"get":{"operationId":"ProfileTerminalController_list","summary":"我的设备列表","description":"我登录过的设备列表。","parameters":[{"name":"page","required":false,"in":"query","description":"当前页数,从 1 开始","example":1,"schema":{"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"每页数目,最大不能超过 50,默认为 10","example":10,"schema":{"default":10,"type":"number"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TerminalSessionRespDto"}}}}},"security":[{"x-authing-app-id":[]},{"bearer":[]}],"tags":["用户资料/API 列表"]}},"/api/v3/mydevices/unbind":{"post":{"operationId":"ProfileTerminalController_unbind","summary":"移除设备","description":"移除某个设备。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnbindDeviceDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommonResponseDto"}}}}},"security":[{"x-authing-app-id":[]},{"bearer":[]}],"tags":["用户资料/API 列表"]}},"/api/v3/mydevices/revoke-session":{"post":{"operationId":"ProfileTerminalController_revoke","summary":"从设备上退出登录","description":"移除某个已登录设备的登录态。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeDeviceSessionDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommonResponseDto"}}}}},"security":[{"x-authing-app-id":[]},{"bearer":[]}],"tags":["用户资料/API 列表"]}},"/api/v2/ecConn/wechatMobile/authByCode":{"post":{"operationId":"WechatMobileController_authByCode","x-authing-hidden-from-sdk":true,"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WechatMobileAuthByCodeInput"}}}},"responses":{"201":{"description":""}}}},"/api/v2/ecConn/wechatMobile/authByCodeIdentity":{"post":{"operationId":"WechatMobileController_authByCodeIdentity","summary":"微信移动端登录","description":"移动端应用:使用微信作为外部身份源登录。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WechatMobileAuthByCodeIdentityInput"}}}},"responses":{"301":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WechatIdentityResolveRespDto"}}}},"default":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginTokenResponseDataDto"}}}}},"tags":["账号绑定/API 列表"]}},"/api/v2/ecConn/wechatMobile/register":{"post":{"operationId":"WechatMobileController_registerNewUser","summary":"微信移动端:使用身份源中用户信息","description":"询问绑定开启时:绑定到外部身份源,根据外部身份源中的用户信息创建用户后绑定到当前身份源并登录。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindByRegiserInputApi"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WechatLoginTokenRespDto"}}}}},"tags":["账号绑定/API 列表"]}},"/api/v2/ecConn/wechatMobile/byEmailCode":{"post":{"operationId":"WechatMobileController_bindByEmailCode","summary":"微信移动端:邮箱验证码模式","description":"询问绑定开启时:绑定到外部身份源,根据输入的邮箱验证用户信息,找到对应的用户后绑定到当前身份源并登录;找不到时报错“用户不存在”。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindByEmailCodeInputApi"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WechatLoginTokenRespDto"}}}}},"tags":["账号绑定/API 列表"]}},"/api/v2/ecConn/wechatMobile/byPhoneCode":{"post":{"operationId":"WechatMobileController_bindByPhoneCode","summary":"微信移动端:手机号验证码模式","description":"询问绑定开启时:绑定到外部身份源,根据输入的手机验证用户信息,找到对应的用户后绑定到当前身份源并登录;找不到时报错“用户不存在”。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindByPhoneCodeInputApi"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WechatLoginTokenRespDto"}}}}},"tags":["账号绑定/API 列表"]}},"/api/v2/ecConn/wechatMobile/byAccount":{"post":{"operationId":"WechatMobileController_bindByAccount","summary":"微信移动端:账号密码模式","description":"询问绑定开启时:绑定到外部身份源,根据输入的账号(用户名/手机号/邮箱)密码验证用户信息,找到对应的用户后绑定到当前身份源并登录;找不到时报错“用户不存在”。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindByAccountInputApi"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WechatLoginTokenRespDto"}}}}},"tags":["账号绑定/API 列表"]}},"/api/v2/ecConn/wechatMobile/select":{"post":{"operationId":"WechatMobileController_selectAccount","summary":"微信移动端:多账号场景","description":"询问绑定开启时:根据选择的账号绑定外部身份源,根据输入的账号 ID 验证用户信息,找到对应的用户后绑定到当前身份源并登录;找不到时报错“用户不存在”。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindByAccountsInputApi"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WechatLoginTokenRespDto"}}}}},"tags":["账号绑定/API 列表"]}},"/api/v2/ecConn/wechatMobile/byAccountId":{"post":{"operationId":"WechatMobileController_bindByAccountId","summary":"微信移动端:账号 ID 模式","description":"询问绑定开启时:绑定到外部身份源,根据输入的账号 ID 验证用户信息,找到对应的用户后绑定到当前身份源并登录;找不到时报错“用户不存在”。","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindByAccountIdInputApi"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WechatLoginTokenRespDto"}}}}},"tags":["账号绑定/API 列表"]}}},"x-tagGroups":[{"name":"开发准备","tags":["开发准备/基本概念","开发准备/HTTP 请求","开发准备/配置安全域","开发准备/鉴权机制","开发准备/密码安全传输","开发准备/接口限流","开发准备/服务对外 IP","开发准备/错误处理","开发准备/使用管理 API"]},{"name":"登录","tags":["登录/概述","登录/API 列表","登录/事件"]},{"name":"管理 Token","tags":["管理 Token/概述","管理 Token/API 列表","管理 Token/常见问题","管理 Token/事件"]},{"name":"登出","tags":["登出/概述","登出/API 列表","登出/事件"]},{"name":"注册","tags":["注册/概述","注册/API 列表","注册/事件"]},{"name":"用户资料","tags":["用户资料/概述","用户资料/API 列表","用户资料/事件","用户资料/常见问题"]},{"name":"账号绑定","tags":["账号绑定/概述","账号绑定/API 列表","账号绑定/事件"]},{"name":"MFA 要素管理","tags":["MFA 要素管理/概述","MFA 要素管理/API 列表","MFA 要素管理/事件"]},{"name":"用户相关资源","tags":["用户相关资源/概述","用户相关资源/API 列表","用户相关资源/事件"]},{"name":"消息服务","tags":["消息服务/概述","消息服务/API 列表","消息服务/常见问题","消息服务/事件"]},{"name":"鉴权","tags":["鉴权/概述","鉴权/API 列表","鉴权/事件"]},{"name":"微信相关接口","tags":["微信相关接口/概述","微信相关接口/API 列表","微信相关接口/事件"]},{"name":"公开信息端点","tags":["公开信息端点/API 列表","公开信息端点/事件"]},{"name":"常见问题","tags":["常见问题/常见问题"]},{"name":"工具与资源","tags":["工具与资源/Quick Start","工具与资源/SDK 列表","工具与资源/使用文档","工具与资源/获取帮助"]},{"name":"事件概述","tags":["事件概述/背景","事件概述/使用场景","事件概述/管理端 SDK 订阅事件流程","事件概述/管理端 SDK 发布事件流程","事件概述/认证端 SDK 发布事件流程","事件概述/认证端 SDK 订阅事件流程","事件概述/通过控制台的自动化功能发布事件流程"]}]}