更新OAuth2客户端
更新时间:2026-07-14
更新OAuth2客户端
- 更新 OAuth2 客户端配置。clientType 创建后不可修改。
OpenAPI Explorer
去调试
您可以在 OpenAPI Explorer 中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer 可以自动生成 SDK 代码示例。
请求结构
Plain Text
1POST /v{version}/agent-identity/user-pool/oauth2-client/update HTTP/1.1
2Host: identity.baidubce.com
3Authorization: authorization string
请求头域
除公共头域外,无其他特殊头域
请求参数
| 参数名称 | 类型 | 是否必需 | 参数位置 | 描述 |
|---|---|---|---|---|
| version | String | 是 | URL参数 | API版本号 |
| userPoolId | String | 是 | RequestBody参数 | 用户池 ID |
| id | String | 是 | RequestBody参数 | 客户端记录 ID |
| name | String | 否 | RequestBody参数 | 新的名称 |
| description | String | 否 | RequestBody参数 | 新的描述 |
| redirectUris | List |
否 | RequestBody参数 | 新的回调地址白名单(最多20个) |
| grantTypes | List |
否 | RequestBody参数 | 新的授权类型 |
| scopes | List |
否 | RequestBody参数 | 新的 scope |
| accessTokenTtl | Integer | 否 | RequestBody参数 | 新的 access_token 有效期 |
| refreshTokenTtl | Integer | 否 | RequestBody参数 | 新的 refresh_token 有效期 |
返回状态码
成功返回200,失败返回见错误码
返回头域
除公共头域外,无其他特殊头域
返回参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| id | String | 客户端记录 ID |
| clientId | String | OAuth2 client_id |
| clientSecret | String | client_secret(get 返回明文,list 不返回) |
| name | String | 客户端名称 |
| description | String | 描述 |
| clientType | String | 客户端类型:WEB_APP / SPA / M2M |
| redirectUris | List |
回调地址白名单 |
| grantTypes | List |
授权类型 |
| scopes | List |
允许的 scope |
| accessTokenTtl | Integer | access_token 有效期(秒) |
| refreshTokenTtl | Integer | refresh_token 有效期(秒) |
| enabled | Boolean | 是否启用 |
| loginUrl | String | 拼装好的 OAuth2 authorize 链接 |
| createdAt | DateTime | 创建时间 |
请求示例
Plain Text
1{
2 "userPoolId": "string",
3 "id": "string",
4 "name": "string",
5 "description": "string",
6 "redirectUris": ["string"],
7 "grantTypes": ["string"],
8 "scopes": ["string"],
9 "accessTokenTtl": 0,
10 "refreshTokenTtl": 0
11}
返回示例
Plain Text
1{
2 "id": "string",
3 "clientId": "string",
4 "clientSecret": "string",
5 "name": "string",
6 "description": "string",
7 "clientType": "string",
8 "redirectUris": ["string"],
9 "grantTypes": ["string"],
10 "scopes": ["string"],
11 "accessTokenTtl": 0,
12 "refreshTokenTtl": 0,
13 "enabled": true,
14 "loginUrl": "string",
15 "createdAt": "string"
16}
评价此篇文章
