从 VMware Cloud Director 10.4.1 开始,可以使用 VMware Cloud Director API 将单个用户从一个身份提供程序 (IDP) 重新映射到另一个身份提供程序 (IDP)。
注:
VMware Cloud Director 将开始弃用本地用户。
VMware Cloud Director 在本地用户弃用时继续完全支持使用这些本地用户。请参见
VMware Cloud Director 10.4.1 发行说明。
有关使用 VMware Cloud Director UI 在身份提供程序之间批量重新映射用户的信息,请参见使用 VMware Cloud Director Tenant Portal在身份提供程序之间重新映射用户。
前提条件
- 确认您的角色包括组/用户:管理权限。
- 确认组织配置了要在其间重新映射的身份提供程序类型。
过程
示例:
要查找要重新映射的用户,请发出以下请求。
请求:
GET /cloudapi/1.0.0/users?pageSize=10 HTTP/1.1 Host: 127.0.0.1:8443 Accept: application/json;version=37.1
示例响应:
{ "resultTotal": 2, "pageCount": 1, "page": 1, "pageSize": 10, "associations": null, "values": [ ..., { "username": "testuser", "fullName": "", "description": null, "id": "urn:vcloud:user:2b038199-0063-4c13-9bba-a3b58d775785", "roleEntityRefs": [ { "name": "vApp Author", "id": "urn:vcloud:role:85f69506-52a5-3e20-869a-ea18d667e19e" } ], "orgEntityRef": { "name": "testorg", "id": "urn:vcloud:org:806f0d87-c8b9-47f5-bfbe-3dc73a4c0d14" }, "password": "******", "email": "", "nameInSource": "testuser", "enabled": true, "isGroupRole": false, "providerType": "LOCAL" } ] }
要将 testuser
从 LOCAL
重新映射到 LDAP
,请发出 PUT 请求。
请求:
PUT /cloudapi/1.0.0/users/urn:vcloud:user:2b038199-0063-4c13-9bba-a3b58d775785 HTTP/1.1 Host: 127.0.0.1:8443 Accept: application/json;version=37.1 Content-Type: application/json;version=37.1 Body: { "username": "testuser", "fullName": "", "description": null, "id": "urn:vcloud:user:2b038199-0063-4c13-9bba-a3b58d775785", "roleEntityRefs": [ { "name": "vApp Author", "id": "urn:vcloud:role:85f69506-52a5-3e20-869a-ea18d667e19e" } ], "orgEntityRef": { "name": "testorg", "id": "urn:vcloud:org:806f0d87-c8b9-47f5-bfbe-3dc73a4c0d14" }, "password": "******", "email": "", "nameInSource": "testuser", "enabled": true, "isGroupRole": false, "providerType": "LDAP" }
示例响应:
{ "username": "testuser", "fullName": "", "description": null, "id": "urn:vcloud:user:2b038199-0063-4c13-9bba-a3b58d775785", "roleEntityRefs": [ { "name": "vApp Author", "id": "urn:vcloud:role:85f69506-52a5-3e20-869a-ea18d667e19e" } ], "orgEntityRef": { "name": "testorg", "id": "urn:vcloud:org:806f0d87-c8b9-47f5-bfbe-3dc73a4c0d14" }, "password": null, "email": "", "nameInSource": "\\63\\36\\62\\35\\30\\66\\35\\63\\2D\\61\\62\\30\\35\\2D\\34\\37\\64\\33\\2D\\62\\61\\64\\34\\2D\\39\\32\\64\\35\\32\\37\\30\\36\\62\\39\\39\\33", "enabled": true, "isGroupRole": false, "providerType": "LDAP" }