Is there a way to get a list of users on a Keycloak realm via REST WITHOUT using an admin account? Maybe some sort of assignable role from the admin console? Looking for any ideas.
Right now I'm using admin credentials to grab an access token, then using that token to pull users from the realm/users
endpoint.
Getting the token (from node.js app via request
):
uri: `${keycloakUri}/realms/master/protocol/openid-connect/token`,
form: {
grant_type: 'password',
client_id: 'admin-cli',
username: adminUsername,
password: adminPassword,
}
Using the token:
uri: `${keycloakUri}/admin/realms/${keycloakRealm}/users`,
headers: {
'authorization': `bearer ${passwordGrantToken}`,
}
I want to be able to use generic user info (usernames, emails, fullnames) from a client application.