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

Retrieving User Session Notes in Keycloak Rest Admin API

As said in the title, I want to retrieve the user session notes that I set during user authentication using this Admin Rest API endpoint: GET /admin/realms/{realm}/users/{id}/sessions. I have successfully created a custom authenticator as suggested…
peltren
  • 53
  • 1
  • 5
2
votes
1 answer

Keycloak Token Endpoint Returning 404 Despite Correct Configuration and URL Format

I'm using Keycloak 20.1.0 in a Docker container and am encountering a persistent 404 - Not Found error when trying to access the token endpoint via a curl command. My realm is named "hasura-app". Here is the curl command I'm using: curl --request…
Blaž
  • 23
  • 2
2
votes
1 answer

How to add dedicated scope to Keycloak via kcadm

I'd like to add dedicated scopes to a client so that it can access information from other clients. Turning full access on works but grants too many permissions. The scopes are already created with their respective clients. It is “only” a matter of…
Samuel
  • 547
  • 1
  • 3
  • 14
2
votes
0 answers

Setting a User Attribute in Event Listener SPI - Keycloak

I'm trying to set a user's attribute after they register in my custom Keycloak extension. My event listener implementation looks as follows: @AutoService(EventListenerProviderFactory.class) public class EventListener implements EventListenerProvider…
2
votes
2 answers

Keycloak 19.0 - Send Welcome User email to registered user

I want to send an email to the registered user once the admin creates a new user saying that " the user successfully registered with the xyz email id.. " Is there any option to achieve this in keycloak 19.03 or above ? Or Is it an out of box option…
2
votes
1 answer

How to add realm-admin to an User using keycloak rest-api

When I add a role to an user, I search that client-role by name and then I get this role representation and add to the user. But I couldn't find out how to search the "realm-admin" role and how to add that to the user with rest api. That's the url…
Carlos Machel
  • 139
  • 12
2
votes
1 answer

When Creating a new user set realmRoles - Keycloak Admin REST API

I'm having a problem when assigning already existing realm roles when creating a user. Following the documentation when creating a new user POST /{realm}/users, in the body parameter using the UserRepresentation, we have field called realmRoles…
rocket_moon
  • 309
  • 4
  • 18
2
votes
1 answer

Use keycloak.protect() in a function that will be used as a middleware in nodejs/expressjs

The route look like this where verifytoken is a middleware. router.get('/v1/endpoint', verifytoken, apis.getData); In order to protect this route we will generally use keycloak.protect(); but I want to use verifytoken which is a middleware and…
2
votes
1 answer

How to get the Roles and Attributes of a Keycloak User

How do I get the roles and attributes of a user using the Java Client of Keycloak? Below is the code that I have written to get the access token of a user, however, I am not able to find the way to get the roles assigned to that user. Configuration…
ghost
  • 425
  • 4
  • 17
2
votes
0 answers

Keycloak 18 proper configuration

I am using Keycloak to authenticate a user for a Vaadin application. The Vaadin application creates its own user session after successful authentication with Keycloak. I need the user to be able to change the password and email address. Now I do not…
alexanoid
  • 24,051
  • 54
  • 210
  • 410
2
votes
1 answer

Cannot set `bearerOnly: true` in Keycloak 19.0

I am trying to secure my backend service but due to the updates with Keycloak 19.0 I can't follow any tutorial online. I am trying to set bearerOnly: true but there are no options to set the access type in new version of Keycloak
2
votes
1 answer

Keycloak query to count users filtered by custom attribute

I'm trying to implement a user management system using Keycloak 16.0. I need to filter and display users by custom attribute in different pages. In order to achieve that, I need a query to count the users for the pagination functionality, and…
2
votes
2 answers

Keycloak create identity provider mapper with admin cli

I'm trying to create a keycloak identity provider mapper with the admin client. It works with json file import, but for some scripting it would be better to have all in the options. When I run the statement I get a class cast exception: kcadm…
Jens Popp
  • 131
  • 1
  • 12
2
votes
1 answer

Can I check if the userid and password are valid in Keyclock?

The user sends me its id and password. Then I want to check if it is valid on the keycloak. I can try to log in, but the session is created in keycloak. I even thought about to log out after logging in. But this is very inefficient. Is there a way…
Ahat
  • 23
  • 1
  • 4
2
votes
1 answer

keycloak - endpoint for register new user

How to register a new user without passing by admin, keycloak offer an interface to register a new user URL for registering new users in the browser directly…