You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Users API: Add support for not exact and OR search of user attributes
#19385
At the moment the query users API is limited to exact search and AND operations for user attributes.
E.g. GET /{realm}/users?q=key1:value1 key2:value2: only users with both key1=value1 AND key2=value2 would be returned. As a user could have multiple values for an attribute key, it is enough if one of the attribute value matches for both attributes.
Idea and motivation
To allow for more flexibility when using the API to query users, it would be nice to have a possibility to query for not exact results and/or to OR match the user attributes. This would also allow for more possibilities in the new admin-console, see: #17728
Idea1: a new separator for key/value could be introduced to indicate whether the search should be exact or not for that attribute.
e.g. GET /{realm}/users?q=key1~val -> would match all users with any attribute key1 value LIKE %val%.
Idea2: a new separator for key/value pairs could be introduced indicating an OR operation.
e.g. GET /{realm}/users?q=key1~val%7Ckey2:value2 -> would match all users with any attribute key1 value LIKE %val% OR any attribute key2 value EQUALS value2.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Current state
At the moment the query users API is limited to exact search and AND operations for user attributes.
E.g.
GET /{realm}/users?q=key1:value1 key2:value2: only users with both key1=value1 AND key2=value2 would be returned. As a user could have multiple values for an attribute key, it is enough if one of the attribute value matches for both attributes.Idea and motivation
To allow for more flexibility when using the API to query users, it would be nice to have a possibility to query for not exact results and/or to OR match the user attributes. This would also allow for more possibilities in the new admin-console, see: #17728
Idea1: a new separator for key/value could be introduced to indicate whether the search should be exact or not for that attribute.
e.g.
GET /{realm}/users?q=key1~val-> would match all users with any attributekey1value LIKE%val%.Idea2: a new separator for key/value pairs could be introduced indicating an OR operation.
e.g.
GET /{realm}/users?q=key1~val%7Ckey2:value2-> would match all users with any attributekey1value LIKE%val%OR any attributekey2value EQUALSvalue2.All reactions