在WSO2 Identity Server API中按角色搜索用户。

huangapple go评论51阅读模式
英文:

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服务提供商可选择支持的操作。

另一种选择是:

  1. 从中获取角色ID
GET {{base_url}}/scim2/Roles?filter=displayName co role1
  1. 然后检索分配给角色的用户
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:

  1. Get role id from
GET {{base_url}}/scim2/Roles?filter=displayName co role1
  1. Then retrieve the users assigned to the role
GET {{base_url}}/scim2/Roles/{{role-id}}?attributes=users

huangapple
  • 本文由 发表于 2023年6月16日 02:57:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/76484732.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定