WSO2 Identity Server 6.0.0:指定SOAP API的REST替代方案咨询
WSO2 Identity Server 6.0.0 SOAP API 转 REST API 对应清单
以下是你提到的SOAP接口对应的REST API替代方案,以及通过用户名/ID获取用户数据的相关接口:
原SOAP接口的REST替代
getUserClaims
使用SCIM 2.0用户查询接口:- 通过
userId获取:GET /scim2/Users/{userId},可通过attributes参数指定需要返回的声明(如attributes=email,locale) - 通过
userName查询:GET /scim2/Users?filter=userName eq "{userName}"
- 通过
updateUserLocale
利用SCIM 2.0的用户更新接口(PATCH方式更灵活):- 请求方法:
PATCH /scim2/Users/{userId} - 请求体示例:
{ "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"], "Operations": [ { "op": "replace", "value": {"locale": "zh-CN"} } ] }
- 请求方法:
updateUserClaim
同样使用SCIM 2.0的用户更新接口,根据声明对应的SCIM属性进行操作:- PATCH方式(推荐):
PATCH /scim2/Users/{userId},在请求体中指定要替换/添加的属性 - PUT方式(全量更新):
PUT /scim2/Users/{userId},提交完整的用户属性数据
- PATCH方式(推荐):
retrieveUserRoles
有两种方式可选:- 专用角色查询接口:
GET /api/server/v1/users/{userId}/roles - SCIM接口获取用户所属组(对应角色):
GET /scim2/Users/{userId}?attributes=groups
- 专用角色查询接口:
getLastLoginTime
通过用户元数据接口获取:- 请求方法:
GET /api/server/v1/users/{userId}/metadata - 返回结果中包含
lastLoginTime字段
- 请求方法:
通过userName或userId获取用户数据的REST API清单
- 获取用户全量信息:
- 按
userId:GET /scim2/Users/{userId} - 按
userName:GET /scim2/Users?filter=userName eq "{userName}"
- 按
- 获取用户角色列表:
GET /api/server/v1/users/{userId}/roles - 获取用户元数据(含最后登录时间):
GET /api/server/v1/users/{userId}/metadata
注意:所有REST接口都需要携带有效的管理员令牌,通过
/oauth2/token接口获取access_token后,放在请求头Authorization: Bearer {access_token}中。
内容的提问来源于stack exchange,提问作者Shweta Nikam
相关产品推荐
相关产品推荐

