Create user via API in KeyCloak without admin-cli?

Imagine a realm my-realm and client my-client were created. Is it possible to create users via API without admin-cli (with secret of my-client client)?

Upvotes: 2

Views: 353

Answers (1)

Bench Vue
Bench Vue

Reputation: 9390

The admin_cli is one of default client. It has the Direct Access Grant. It means user can get the access token to use it for client_id parameter when the get access toke (POST) call.

grant_type=password - This tells the server you’re using the Password grant type
username= - The user’s username that they entered in the application
password= - The user’s password that they entered in the application
client_id= - The public identifier of the application that the developer obtained during registration
client_secret= - (optional) - If the application is a “confidential client”

If you made your own client(example: my-client) and it has Direct Access Grant, you can using that instead of admin-cli.

This is admin-cli's grant_type image.

enter image description here

The password grant_type is one of the simplest OAuth grants and involves only one step

You can see other grant_types too in here

client_credentials, authorization_code, refresh_token

Upvotes: 2

Related Questions