英文:
Search Users by role on WSO2 Identity Server API
问题
我需要使用WSO2 Identity Server API搜索所有具有特定角色的用户。
我正在调用GET /scim2/Users?filter=roles+Co+roleName
但是我从API收到以下答案:
不支持的属性:urn:ietf:params:scim:schemas:core:2.0:User:roles
有谁知道如何在筛选器中添加属性角色?
谢谢。
英文:
I need to search all users that have a specific role using the WSO2 Identity Server API.
I'm calling GET /scim2/Users?filter=roles+Co+roleName
But I receive the following answers from the API:
Unsupported attribute: urn:ietf:params:scim:schemas:core:2.0:User:roles
Does anyone know how to add the attribute role in the filter?
Thanks
答案1
得分: 1
根据RFC https://datatracker.ietf.org/doc/html/rfc7644#section-3.4.2.2,筛选条件应如下。
GET {{base_url}}/scim2/Users?filter=roles[display co role1]
然而,WSO2 IS不支持多值复杂属性筛选。
注意:筛选是SCIM服务提供商可选择支持的操作。
另一种选择是:
- 从中获取角色ID
GET {{base_url}}/scim2/Roles?filter=displayName co role1
- 然后检索分配给角色的用户
GET {{base_url}}/scim2/Roles/{{role-id}}?attributes=users
英文:
As per the the RFC https://datatracker.ietf.org/doc/html/rfc7644#section-3.4.2.2,
filter should be as follows.
GET {{base_url}}/scim2/Users?filter=roles[display co role1]
However, WSO2 IS doesn't support multivalued complex attribute filtering.
NOTE: Filtering is an optional operation to be supported by the SCIM service provider
The alternative option is:
- Get role id from
GET {{base_url}}/scim2/Roles?filter=displayName co role1
- Then retrieve the users assigned to the role
GET {{base_url}}/scim2/Roles/{{role-id}}?attributes=users
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论