创建认证源
更新时间:2020-07-09
接口描述
本接口用于创建客户自定义认证源,并关联到指定项目。LDAP认证源在创建时会检查LDAP服务器的访问,访问失败则不允许创建
请求结构
POST /v{version}/provider HTTP/1.1
Host: idaas.baidubce.com
Authorization: authorization string
{
"projectId":"projectId",
"name":"name",
"icon":"icon",
"displayName":"displayName",
"customName":"customName",
"customComment":"customComment",
"comment":"comment",
"providerType":"providerType",
"authType":"authType",
"authConfig": {...},
"bindType":"bindType",
"status":status
}
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必需 | 参数位置 | 描述 |
---|---|---|---|---|
version | String | 是 | URL参数 | API版本号 |
projectId | String | 是 | RequestBody参数 | 认证源绑定的项目id |
name | String | 是 | RequestBody参数 | 认证源名称 |
comment | String | 否 | RequestBody参数 | AD 认证源描述 |
bindType | String | 是 | RequestBody参数 | 建绑方式:NAME/ID |
status | Integer | 否 | RequestBody参数 | 创建完成后认证源的初始状态,0为禁用,1为启用,不指定则默认为0 |
organizationUnitId | String | 否 | RequestBody参数 | 认证源绑定的ouId,传空会默认使用rootou |
authType | String | 是 | RequestBody参数 | 认证协议,支持LDAP,OIDC,JWT |
authConfig | Object | 是 | RequestBody参数 | 协议配置,由协议类型决定,见AuthConfig对象 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
见Provider模型
请求示例
POST https://idaas.baidubce.com/v1/provider
Host: idaas.baidubce.com
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
{
"projectId": "cadd0f870d304c5fa6eccdd4002145dd",
"name": "testopld",
"icon": "icon",
"displayName": "display",
"customName": "customName",
"customComment": "customComment",
"comment": "comment",
"providerType": "Custom",
"authType": "LDAP",
"authConfig": {
"type": "LDAP",
"saveSession": false,
"ldapType": "OPEN_LDAP",
"serverUrl": "10.14.236.230",
"baseDN": "dc=bcetest-ad,dc=com",
"useSSL": false,
"adminDN": "cn=cixiao,ou=serverrd,ou=rd,ou=people,dc=bcetest-ad,dc=com",
"adminPwd": "zcx123456",
"syncOu": true,
"syncUser": true,
"userBindingProperty": "uid",
"syncPassword": false
},
"bindType": "NAME",
"status": 0
}
响应示例
HTTP/1.1 201 CREATED
Content-Type: application/json;charset=UTF-8
Date: Wed, 08 Jul 2015 03:28:11 GMT
x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
Server: BWS
{
"id": "57a3fc1043844744a6f5ec844c388d79",
"icon": "icon",
"name": "testopld",
"displayName": "display",
"comment": "comment",
"providerType": "Custom",
"authType": "LDAP",
"authConfig": {
"type": "LDAP",
"saveSession": false,
"ldapType": "OPEN_LDAP",
"serverUrl": "10.14.236.230",
"baseDN": "dc=bcetest-ad,dc=com",
"useSSL": false,
"adminDN": "cn=cixiao,ou=serverrd,ou=rd,ou=people,dc=bcetest-ad,dc=com",
"adminPwd": "zcx123456",
"syncOu": true,
"syncUser": true,
"userBindingProperty": "uid",
"certExpired": false,
"syncPassword": false
},
"bindType": "NAME",
"projectId": "cadd0f870d304c5fa6eccdd4002145dd",
"organizationUnitId": "05ba20bdc82f4d81bd2665cba8306459",
"status": 0
}