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
1 answer

Creating users error: /roles endpoint Keycloak HTTP 404

I've got trouble with creating users via restapi on my keycloak service again. It's creating a user but not assiging the correct role afterwards. Figured out that the code failes on the following part private void assignRoleToUser(String userId,…
R. Polito
  • 544
  • 6
  • 21
2
votes
0 answers

Keycloak REST API 401 when using custom client with service account

we want to access the Keycloak (Version 10) REST API from one of our backend services. To authenticate, we have setup the followings: new clients within our realm enabled service account for that client assigned all [1] roles of “realm-management”…
martn_st
  • 2,576
  • 1
  • 24
  • 30
2
votes
1 answer

How to integrate keycloak sms authentication by API?

I have a keycloak server and Laravel application using custom KeycloakProvider: public function loginByEmail(string $email, string $password): SsoTokens { try { $data = $this->realmEndpoint->makeRequest( …
2
votes
2 answers

Unable to authenticate the login of application user using Keycloak

I am working over integration of React application with Keycloak. I have installed the Keycloak server version 11.0.2 over my local machine. I am able to access the administrative login and create the admin user. I have also created a custom client…
knowledge20
  • 1,006
  • 3
  • 14
  • 25
2
votes
1 answer

Unable to view the Login Page on keycloak

I am working over integration of React application with KeyCloak. I have installed the keycloak server version 11.0.2 over my local machine. I am able to access the administrative login and create the admin user. I have also created a custom client…
knowledge20
  • 1,006
  • 3
  • 14
  • 25
2
votes
1 answer

How to get roles from custom client in keycloak?

To get roles in a custom client I know I need to do two APIs. One is to get an access token and one is to get the roles. My doubt is, should I get accessToken by sending admin-CLI details in headers or because I want roles of the custom client I…
m9m9m
  • 1,655
  • 3
  • 21
  • 41
2
votes
2 answers

How can custom keycloak error message in NodeJS

I'm newbie on node, I have a rest api with express and some endpoint are with keycloak security using keycloak-connect. I need a custom response when error 403 ocurrs, ie custom message in json format. I use a handler to managed some other status…
Hector
  • 691
  • 2
  • 14
  • 28
2
votes
1 answer

Keycloak: Can not get attributes of a role

I have set an attribute to a role.Go to Roles->Edit a role->go to tab Attributes and then add a key and a value. Then with the below code I try to retrieve the attribute. I manage to retrieve all roles (role.getName() has a value) but the attributes…
Fotios
  • 79
  • 8
2
votes
1 answer

Login to Keycloak that is behind Spring Cloud Api Gateway

I have Keycloak and one Microservice running behind Spring Cloud API Gateway. I want to allow a client application to perform a /login HTTP request to let users login with their user name and password. Because the client application will use the…
2
votes
1 answer

customize user session data in keycloak

I used this curl command to retrieve session details for a user in keycloak: curl -X GET \ -H 'Authorization: Bearer $TOKEN' \ http://192.168.X.X:8080/auth/admin/realms/$REALM_NAME/users/$ID_OF_CLIENT/sessions and in response we have: [{ …
M-E
  • 168
  • 4
  • 19
2
votes
0 answers

Create Keycloak user via rest api without bear token

Currently, I tried to find a way to create a keycloak user and just found cases that need to have an admin access token (mean that need to log in with admin account first). My client-server(java) system using keycloak for authentication and need a…
Hai tran
  • 21
  • 1
1
vote
2 answers

Keycloak REST API > Is it possible to update user session data using admin REST API?

I would like to update an attribute of the user session using Keycloak admin REST API, it seems not feasible. Is there any way to do so?
Abbadon
  • 2,513
  • 3
  • 25
  • 33
1
vote
2 answers

Keycloak 22.0.1: User login unauthorized

I'm trying to login a user after being created but i get the 401 Unauthorized response. def login_to_keycloak(username, password): auth_data = { "grant_type": "password", "client_id": KEYCLOAK_CLIENT_ID, "client_secret":…
Diego Portillo
  • 103
  • 1
  • 7
1
vote
1 answer

Will keycloak store the LDAP Mappers values stored in keycloak DB?

In Keycloak db I can see user details which are imported from LDAP but not attributes(Mappers), anyone please provide the informaiton about table where it will be stored. I wanted to develop one API for users info, I am not able achive with exsting…
Naresh M
  • 51
  • 7
1
vote
1 answer

Get user list in my keycloak (18.0) realm with client roles

I need to get the user list within the Client Roles of my realm via REST API. I'm using an admin user in my realm and I assigned him view-users (in Role Mappings - Client Roles -> realm-management -> view-users). Here my results of GET calls: get…
pasquy73
  • 563
  • 3
  • 13