Skip to main content

Step 4. Create Users

Users are associated to realms. Newly created realms will not have any users so you will need to create one or more users for your application.

Create a User

You can create a new user by following these steps:

  1. Open the Keycloak Admin Console
  2. Select "Users" from the main menu

Users menu item

  1. Click on the "Create new user" button
  2. Enter a username, first name and last name for the user

Create a user

  1. Click on the "Create" button

This will create the basic user. To be able to login this user will need a password to be configured. Do this by following these steps:

  1. Select the "Credentials" tab
  2. Click on the "Set password" button
  3. Enter a password for the user
  4. Optionally set the password to be temporary (user must change on next login)
  5. Click on the "Save" button

Set a password

Repeat these steps to add as many users as you need for your application.

Assign Users to Roles

Once you have created users you will need to assign them to the roles you created for your client. To do this follow these steps:

  1. Open the Keycloak Admin Console
  2. Select "Users" from the main menu
  3. Select the required user from the list of users
  4. Select the "Role mapping" tab
  5. Click on the "Assign role" button
  6. Select "Filter by clients" to view client roles and optionally enter a term to filter the roles by name

Set a password

  1. Select the required roles
  2. Click on the "Assign" button

Repeat these steps to assign roles to as many users as you need for your application. Users can have multiple roles.