[keycloak-user] Create user API in keycloak with default password

Don Reynolds (dreynold) Don.Reynolds at quest.com
Tue Nov 6 10:27:17 EST 2018


Hello Shubham,

Yes, this can be done.  Easiest way to see is to turn on developer tools in the browser and watch the network traffic as you use "Users->Credentials" tab in the Keycloak admin console to set a non-temporary password for a user.

Once you have created the user via the api, you can then call a second api call to " reset-password " to set the password.
It should looks something like this:

PUT
PUT /admin/realms/{realm}/users/{id}/reset-password

Request payload:
{"type":"password","value":"Password01","temporary":false}

The key is to set "temporary" to false.  Otherwise the user will be prompted to change their password next time they log in.

Hope that helps,
Don


> -----Original Message-----
> From: keycloak-user-bounces at lists.jboss.org <keycloak-user-
> bounces at lists.jboss.org> On Behalf Of Shubham Akodiya
> Sent: Tuesday, November 6, 2018 6:41 AM
> To: keycloak-user at lists.jboss.org
> Subject: [keycloak-user] Create user API in keycloak with default password
> 
> Hi Team,
> 
> Is there any API available for creating the user with default password ?
> I've gone through the API - POST /{realm}/users
> <https://www.keycloak.org/docs-api/4.5/rest-
> api/index.html#_users_resource> but didn't find the password setting field for
> new user.
> 
> 
> Thanks,
> Shubham Akodiya
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user



More information about the keycloak-user mailing list