How can I create a service account in the master realm with the same admin capabilities as the admin user in Keycloak 26.2.5 · keycloak keycloak · Discussion #40077 · GitHub
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
How can I create a service account in the master realm with the same admin capabilities as the admin user in Keycloak 26.2.5
#40077
I have created a client (ntrcpt_service) and selected "Service account roles". I have added the "admin" role to the client's service account roles. I am able to authenticate with the ntrcpt_service client. I am able to programmatically create a new realm (acme.com) via the api. When I subsequently get the new acme realm via the keycloak rest api (in the same session) using the ntrcpt_service client, I get a 200 but the response contains very limited realm information and when I try to update the acme realm with a put I get a 403. Using the exact same code, but authenticating with a user account (ntrcpt_admin) that has the same roles assigned as the service account, everything works as expected, i.e., I get the full response from a get and the put succeeds. I would appreciate any help you can provide in getting my service account working.
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.
I have created a client (ntrcpt_service) and selected "Service account roles". I have added the "admin" role to the client's service account roles. I am able to authenticate with the ntrcpt_service client. I am able to programmatically create a new realm (acme.com) via the api. When I subsequently get the new acme realm via the keycloak rest api (in the same session) using the ntrcpt_service client, I get a 200 but the response contains very limited realm information and when I try to update the acme realm with a put I get a 403. Using the exact same code, but authenticating with a user account (ntrcpt_admin) that has the same roles assigned as the service account, everything works as expected, i.e., I get the full response from a get and the put succeeds. I would appreciate any help you can provide in getting my service account working.
Here's the service account client:
...and here's a screenshot of the service account user roles showing the acme.com realm roles:

All reactions