Staff User

In this lesson, we'll expand our user management system by adding a staff user and role to Keycloak.

Adding the Staff User

Creating a new staff user in Keycloak follows the same pattern we used for our other users, but with staff-specific details:

  1. Navigate to the Users page in the Keycloak admin console
  2. Click "Add User" and provide these details:
    • Username: staff
    • Email: staff@example.com
    • First Name: staff
    • Last Name: user

Creating the Staff Role

The staff role will be used to control access to staff-specific features in our application:

  1. Navigate to "Realm Roles" in the sidebar
  2. Click "Create Role"
  3. Set the role name as ROLE_STAFF
  4. Save the role

Assigning the Role

To connect our new user with their role:

  1. Go back to Users and select the staff user
  2. Click on "Role Mapping"
  3. Choose "Assign Role"
  4. Filter by realm roles
  5. Select ROLE_STAFF
  6. Confirm the assignment

Summary

  • Added the staff user to Keycloak
  • Added the ROLE_STAFF role to Keycloak
© 2026 Devtiro Ltd. All rights reserved