Enforce your Admin Account Security
Overview
Administrative accounts have elevated privileges and access to sensitive configurations in Keycloak. Securing these accounts is critical to prevent unauthorized access, privilege escalation, or compromise of your identity management infrastructure.
Keycloak provides built-in features such as strong password policies, multi-factor authentication (MFA), and brute force detection to protect admin accounts.
Use Case
IAM
For internal Identity and Access Management (IAM), securing admin accounts prevents accidental or malicious changes to internal systems, policies, and employee accounts.
CIAM
In customer-facing applications, protecting admin accounts safeguards user data, configurations, and authentication workflows from unauthorized modifications.
Pros & Cons
Pros
- Enhanced Security: Reduces the risk of unauthorized access to Keycloak admin functions.
- Compliance: Supports regulatory requirements for privileged accounts.
- Auditability: Enables tracking of sensitive admin operations.
Cons
- Increased Complexity: MFA and strong passwords may slightly slow login.
- Device Requirements: Admins must have access to MFA devices or apps.
Supported by Keycloak
Yes, natively supported and configurable on Managed Keycloak by Cloud-IAM.
Configuration
Create your Admin account and Remove the default Admin account
Create your personal account in the Master realm
- Login in to Keycloak using the default Admin user
- Select the Master realm
- Navigate to the
User
section - Select
Add user
- Fill in your personal details (email, first name, last name)
- Then Click on
Create

Register your future credential
- Go to
Credentials
tab - Click on
Set Password
- Choose a strong, unique password for your admin account:
- At least 12 characters long
- Random combination of letters, numbers, and symbols
- Avoid common words, names, or reused passwords
- Uncheck the Temporary toggle
- Click
Save
andSave password
to confirm the password - Verify that the new password appears on the list

Always Keep an Admin Password
At least one admin account should always retain a locally managed password. Keeping a local admin password ensures that you can always access your Keycloak Master realm, even during external service interruptions.
Relying solely on external Single Sign-On (SSO) providers may prevent access if the external service experiences downtime or if there is a misconfiguration during setup.
Assign to your new personal account admin role
- Go to
Role mapping
tab - Click on
Assign role
- Click on Filter by realm role
- Select
admin
- role_admin - Then click
Assign
the admin role - You can now log out from the default Admin user account

Delete default Admin User
- Log in with your new personal admin account
- Navigate to the
Users
section - Find the default
admin
user, click the...
menu - Select
Delete
thenDelete
to confirm
You have now created your own admin account and removed the default admin account.

Admin
UserCreate another admin account
For secure and resilient access management, it is strongly recommended to maintain at least two admin accounts in your Keycloak. This ensures continuity and control if one administrator loses access to their account, preventing potential lockouts and maintaining operational security.