How to reset user password in keycloak using REST API

Viewed 6706
2 Answers

For accessing the Admin Rest API you need to pass on the admin token to REST CALLS:

You would have been prompted to create an admin account as soon as you would have opened {keycloak-url}/auth.

You can use this admin account to obtain the admin token as shown below.

Note that only change you have to do in below call is your keycloak server address and value of admin username and password.

enter image description here

You can pass the token obtain above on to the REST aPIs with Authroization header.

Please refer to my other SO post for a step by step guide to do this.

@tryingToLearn thank You so much!

I'll post what I did.

  1. Get token for master realm admin account:

enter image description here

  1. Call reset password service in test realm

enter image description here

I've had wrong body so correct body for this request is ["UPDATE_PASSWORD"] and You can notice 204 in the right bottom corner.

The second question is, is it possible to have special user in any realm, not master realm admin for getting a token?

Related