Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keycloak, not returning access token if update password action selected

Tags:

I am calling /auth/realms/master/protocol/openid-connect/token to get access token by sending below content in body, grant_type=password&client_id=example-docker-jaxrs-app&username=user&password=password&client_secret=1d27aedd-11c2-4ed2-97d5-c586e1f9b3cd

but when I put update password as required action to user from keycloak admin console getting following error when try to get token by above mentioned api,

{     "error": "invalid_grant",     "error_description": "Account is not fully set up" } 

one more thing, What is difference in 2 setting, Temporary password and Update password Required action ?

Temporary flag here in users credential tab

Update password as required action in user details tab

like image 551
Shailesh Narkhede Avatar asked Mar 01 '17 05:03

Shailesh Narkhede


People also ask

How do I get refresh token Keycloak?

To get a new access token with a refresh token, in the request to get the access token, you just need to pass grant_type=refresh_token, the value of the refresh token that we had in the previous request to get the access token, client ID and client secret.

How do I specify refresh tokens lifespan in Keycloak?

The refresh tokens lifespan is defined by the "Client Session Max" parameter in the "Tokens" tab of the Realm settings. It can also be overridden on individual clients level under the "Advanced Settings" menu of the client settings page. The maximum time before a refresh token is expired and invalidated.

How do you get a Keycloak access token?

Navigate to the Postman Authorization tab of your request. From the Type dropdown menu, select OAuth 2.0: Click on the Get New Access Token button that will open a dialog box for configuring the identity server (Keycloak in our case).


1 Answers

If you mark the password as temporary a user action to update password is marked as required.

And until the password has been updated/set by the user i.e. this action has been completed, you won't be able to get an access token using this user since the account is not "fully setup" and is in a kind of intermediate state where an action is required to complete the setup.

like image 82
ritesh.garg Avatar answered Sep 20 '22 15:09

ritesh.garg