创建用户池
更新时间:2026-07-14
创建用户池
- 在当前 domain 下创建一个用户池,以 (domain_id, name) 唯一。
OpenAPI Explorer
去调试
您可以在 OpenAPI Explorer 中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer 可以自动生成 SDK 代码示例。
请求结构
Plain Text
1POST /v{version}/agent-identity/user-pool/create HTTP/1.1
2Host: identity.baidubce.com
3Authorization: authorization string
请求头域
除公共头域外,无其他特殊头域
请求参数
| 参数名称 | 类型 | 是否必需 | 参数位置 | 描述 |
|---|---|---|---|---|
| version | String | 是 | URL参数 | API版本号 |
| name | String | 是 | RequestBody参数 | 用户池名称(1-64字符,仅允许字母、数字、下划线、连字符) |
| description | String | 否 | RequestBody参数 | 用户池描述(最多256字符) |
返回状态码
成功返回200,失败返回见错误码
返回头域
除公共头域外,无其他特殊头域
返回参数
UserPoolDTO 对象
| 参数名称 | 类型 | 描述 |
|---|---|---|
| id | String | 用户池 ID |
| domainId | String | BCE 账户 ID |
| name | String | 用户池名称 |
| description | String | 用户池描述 |
| userCount | Integer | 用户池内用户数量 |
| clientCount | Integer | 用户池内 OAuth2 客户端数量 |
| idpCount | Integer | 用户池内 IdP 配置数量 |
| callbackUrl | String | 统一 IdP 回调地址 |
| discoveryUrl | String | OIDC Discovery URL |
| authorizationEndpoint | String | 授权端点 |
| tokenEndpoint | String | Token 端点 |
| userinfoEndpoint | String | UserInfo 端点 |
| jwksUrl | String | JWKS 端点 |
| enabled | Boolean | 是否启用 |
| createdAt | DateTime | 创建时间 |
请求示例
Plain Text
1{
2 "name": "my-pool",
3 "description": "业务用户池"
4}
返回示例
Plain Text
1{
2 "id": "01961a2b3c4d5e6f7890abcdef123456",
3 "domainId": "d-xxxxxxxxxx",
4 "name": "my-pool",
5 "description": "业务用户池",
6 "userCount": 0,
7 "clientCount": 0,
8 "idpCount": 0,
9 "callbackUrl": "https://identity.bce.baidu.com/v1/agent-identity/inbound/callback/01961a2b3c4d5e6f7890abcdef123456",
10 "discoveryUrl": "https://identity.bce.baidu.com/v1/agent-identity/inbound/01961a2b3c4d5e6f7890abcdef123456/.well-known/openid-configuration",
11 "authorizationEndpoint": "https://identity.bce.baidu.com/v1/agent-identity/inbound/01961a2b3c4d5e6f7890abcdef123456/authorize",
12 "tokenEndpoint": "https://identity.bce.baidu.com/v1/agent-identity/inbound/01961a2b3c4d5e6f7890abcdef123456/token",
13 "userinfoEndpoint": "https://identity.bce.baidu.com/v1/agent-identity/inbound/01961a2b3c4d5e6f7890abcdef123456/userinfo",
14 "jwksUrl": "https://identity.bce.baidu.com/v1/agent-identity/inbound/01961a2b3c4d5e6f7890abcdef123456/.well-known/jwks.json",
15 "enabled": true,
16 "createdAt": "2025-06-01T00:00:00Z"
17}
评价此篇文章
