Questions tagged [keycloak-rest-api]

This tag should be used for questions related to the Keycloak Admin Rest API. For instance, "is there an endpoint where I can request X information about the users?"

The Keycloak features provided by the Admin Console can be triggered via the Keycloak's Admin Rest API.

472 questions
2
votes
2 answers

How to add Keycloak client-role to group via REST API

Similar to this Question I am trying to add a Role to a Group (Group Role Mapping). Except that in my case I need to add a client role instead of a realm role. I tried to adapt the Answer in the mentioned question to my needs but sadly without…
flololan
  • 373
  • 1
  • 2
  • 13
2
votes
0 answers

Authentication on Keycloak through REST API (Next JS)

I have a problem. I need to login in Keycloak, but i don't want to use default pages from Keycloak. I have pages for "sign-in" and "sign-up". I wrote requests and can recieve access token for user, but what i should to do next? I use…
2
votes
2 answers

Keycloak view-users, manage-users and admin roles not found in Services Account Roles

I'm trying to define Services Account Roles in Keycloak to list users via the REST API. But manage-users, view-users and admin not found. It's necessary this permission roles to resolve this error (unknown_error), according to: Keycloak Admin Rest…
Muka
  • 1,190
  • 1
  • 12
  • 27
2
votes
1 answer

jsonwebtoken.verify method giving error from keycloak token

I use the /auth/realms//protocol/openid-connect/certs endpoint and hardcode the x5c public key returned from this endpoint to try to get this code working (wrapped in BEGIN RSA/END RSA tags) like so: let x5c =…
Mike
  • 609
  • 12
  • 36
2
votes
1 answer

Which roles enable a user in a Keycloak Realm to use the Admin-REST-API?

Which roles / configuration are needed for a user that is not in the master realm to effectively use the Keycloak 15 Admin REST API? We are successfully using an account that is assigned the realm-admin role in the realm-management client to get a…
2
votes
2 answers

Keycloak Account management api update password does not work

I am trying to update my password via keycloak account management using postman and I get this error: "error": "RESTEASY003650: No resource method found for POST, return 405 with Allow header" My endpoint: http://keycloak_url/auth/realms/{realm…
2
votes
2 answers

Keycloak Token Exchange refresh_token requested_token_type unsupported

I am using token_exchange to impersonate as another user in the same realm. This endpoint works fine for access_token retrieval. However since the access token will expire after sometime, I would like to also have refresh token so that I can…
Uma Ilango
  • 968
  • 4
  • 16
  • 31
2
votes
1 answer

From Keycloak Login : How can I get the Bearer Token from KEYCLOAK_IDENTITY/KC_RESTART cookie

I have a UI application running on ReactJS. For login we are redirecting it to keycloak login page. After providing the username and password on keycloak login page, I am seeing that KEYCLOAK_IDENTITY/KC_RESTART are set. I have validated the…
2
votes
1 answer

Where to store user data in keycloak? And how to read it?

I have set up keycloak following this guide: https://hub.docker.com/r/jboss/keycloak/ using MySQL as a database. I figured that with attributes additional data can be stored in keycloak and with mappers it is possible to associate the data with…
Yggdrasill
  • 166
  • 1
  • 3
  • 16
2
votes
0 answers

Keycloak Cross Realm Token Exchange

I am new to keycloak, and I was struggling with how to initiate a token exchange request. I have an OpenID client A configured in Realm A. My requirement is to exchange the token I received from client A, to get the token from client B configured in…
Sachin Bose
  • 127
  • 8
2
votes
0 answers

keycloak-js How to authenticate AND authorize users

I'm having a bit of trouble understanding how to link together authenticating and authorizing users in my frontend using Keycloak and the keycloak-js adapter. To preface this: I know that the keycloak-js adapter requires the client to have public as…
2
votes
1 answer

How to get an unobfuscated client-secret for keycloak client-secret REST call

When calling the keycloak REST api (see below) the output value is a string of asterisks (stars) - is it possible to get this information in clear text? curl \ --silent \ --request GET \ -H "Authorization: bearer " \ …
2
votes
1 answer

Keycloak API get each role for a specific user

I try to access every role for the user 7b244fd8-5e1a-43af-9572-91d50784fda7 and found this code (Keycloak User Roles missing in REST API): GET /auth/admin/realms/{realm}/users/{user-uuid}/role-mappings/clients/{client-uuid} This is why I try to…
Data Mastery
  • 1,555
  • 4
  • 18
  • 60
2
votes
2 answers

Keycloak REST API Unable to Delete client-level roles from user role mapping

Hoping someone can help me on this. I've created my own Keycloak Realm, and client. I am using Spring boot and KeycloakRestTemplate from org.keycloak.adapters.springsecurity.client.KeycloakRestTemplate; to make all my calls. I've been successful in…
Ali_Ahmed
  • 23
  • 3
2
votes
3 answers

Is there a way to add a user to several groups (in bulk) in Keycloak using Keycloak Admin REST API?

At the moment I am adding the user to one group at a time using this endpoint: PUT /{realm}/users/{id}/groups/{groupId} In my use case it would be beneficial to perform the affectations in bulk, so far I haven't found a documented way of doing so,…
E. Karim
  • 649
  • 7
  • 14