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:
- Navigate to the Users page in the Keycloak admin console
- Click "Add User" and provide these details:
- Username:
staff - Email:
staff@example.com - First Name:
staff - Last Name:
user
- Username:
Creating the Staff Role
The staff role will be used to control access to staff-specific features in our application:
- Navigate to "Realm Roles" in the sidebar
- Click "Create Role"
- Set the role name as
ROLE_STAFF - Save the role
Assigning the Role
To connect our new user with their role:
- Go back to Users and select the staff user
- Click on "Role Mapping"
- Choose "Assign Role"
- Filter by realm roles
- Select
ROLE_STAFF - Confirm the assignment
Summary
- Added the staff user to Keycloak
- Added the
ROLE_STAFFrole to Keycloak