1

I am trying to query custom attribute created in keycloak server. example code : keycloak.users.find({ customAttribute: 'value' }) but I am unable to do that. It returns all the users in keycloak instead of users that match the condition

Subodh Joshi
  • 12,717
  • 29
  • 108
  • 202
testidvic
  • 31
  • 4
  • Where you get the code how to access the customAttribute ? – Subodh Joshi Dec 06 '21 at 06:19
  • Does this answer your question? [Retrieve Custom Attribute from JavaScript (using Javascript Adapter) Keycloak](https://stackoverflow.com/questions/53224680/retrieve-custom-attribute-from-javascript-using-javascript-adapter-keycloak) – Subodh Joshi Dec 06 '21 at 06:21
  • Thanks for help but it doesn't answer my question. I can fetch custom attributes but I want to fetch users based on that attribute like we query users with firstname and lastname in keycloak. For instance I want to fetch users from keycloak that meet certain criteria from custom attribute. Suppose that attribute name is `custom` and I want to fetch users that are having value `abc` for this custom attribute. I got the code from `https://github.com/keycloak/keycloak-nodejs-admin-client/blob/main/test/users.spec.ts` they have a test case for custom attribute – testidvic Dec 08 '21 at 04:54
  • Please provide enough code so others can better understand or reproduce the problem. – Community Dec 11 '21 at 07:34

0 Answers0