Enforcing MFA for Keycloak administrators

Keycloak administrator MFA is set through authentication flows, required actions and break-glass procedures, not a single switch. This page explains the design, the setup sequence and the evidence auditors ask for.

On this page

Why Keycloak admin MFA needs its own design

A password alone is a weak control for a Keycloak administrator, because an admin account can change every realm, client, user federation link and identity provider in the server. Whoever signs in as an admin can add a new identity provider that trusts an attacker's IdP, register a client with broad redirect URIs, or export and modify user data. Enforcing a phishing-resistant second factor for every administrator is therefore the control that protects the server itself, not just one application behind it. This applies most strongly in regulated environments, on shared admin consoles where several operators sign in with the same workstation, and wherever administrative actions are reachable through the Administration REST API with a token issued to an admin user.

Administrator MFA is not one switch. The master realm holds the server administrators and needs its own authentication flow and required actions. Each other realm has its own realm administrators, managed through realm-level roles, and those users sign in through the master realm's admin console unless you design it otherwise, so the browser flow, OTP or WebAuthn policy and conditions must be checked in both places. Enrollment is handled through required actions such as configuring an OTP or WebAuthn credential, and the bootstrap admin account and break-glass accounts need a documented recovery path that does not depend on the MFA you are enforcing. Confirm in your own test instance which flows apply to each login path before you treat the setting as complete.

Treat this as a joint configuration and process project. The configuration side covers flows, required actions, credential policy, the admin hostname or path restrictions described in the Keycloak server administration guide and logging of admin events. The process side covers who can reset an admin's second factor, how that reset is verified, and what evidence is kept for an auditor. Ask your team to name the accountable owner for each step before implementation starts, because an MFA rule that exists only in a configuration export will not satisfy a reviewer who asks who approved an exception.

Which admin MFA design fits each Keycloak layout

This table compares the main ways to require a second factor for Keycloak administrators, from master realm browser flows to per-realm delegated admin flows and enrollment required actions. Read each row for when the option fits, what it protects, and the cost you should plan for before choosing a design.

Design optionWhen it fitsWhat it protectsMain cost to plan for
Master realm browser flow with required second factorOne central team administers all realms from the master realmAccess to the master realm and the admin console used to manage every realmLockout risk if the only admin loses the factor, so recovery must be tested first
Per-realm admin flow for delegated administratorsBusiness units or tenants manage their own realm with separate adminsLimits a realm admin's reach to that realm and applies its own MFA ruleMore flows to build, review and keep consistent across realms
WebAuthn-only second factorAdministrators can be issued hardware security keys or platform passkeysPhishing resistance, because the credential is bound to the legitimate originLost or replaced key handling, and a fallback plan for users without a compatible device
TOTP authenticator app as second factorAdmins need a factor they can enroll quickly on a personal or managed phoneProtects against password theft, but is not bound to the site and can be phishedLess assurance than WebAuthn, so confirm it meets your own admin policy
Enforced required action for enrollmentNew or existing admins must register a factor before their next sign-in completesEnsures no admin account works without a second factor after the rule is appliedSupport effort during rollout, and a need to confirm which accounts were missed
Break-glass bootstrap admin with separate factorA small number of emergency accounts are kept for when normal admin access failsKeeps a path to recovery that does not depend on the day-to-day admin factorSecure storage, periodic testing and audit review of every use

How an administrator login passes through MFA and recovery

The flow starts with an administrator reaching the admin console or Administration REST API through a reverse proxy on a separate admin hostname, which sits outside the public frontend boundary. The master realm authentication flow then runs its password step and second-factor step, and the session is only accepted once that second factor is verified. A separate break-glass account sits behind its own controls and is never used for daily work. Check that the admin hostname is unreachable from the public frontend, that every admin path requires the second factor, and that the recovery account's use is logged and alerted.

Admin login path through the admin hostname, the second factor and the separate break-glass account.

How master realm and per-realm admin flows differ

The master realm holds the administrator accounts for the whole Keycloak server, and those accounts can manage every other realm. Each realm can also have its own administrative users and roles, scoped to that realm only. That split means an MFA design for administrators is not a single setting. You have to decide which accounts sit in the master realm, which sit in each tenant realm, and whether the same second-factor rule applies to both. Start by listing every realm and every account group that can reach an admin console, because the admin sign-in path can differ between them.

The authentication flow used for administrator sign-in has to be checked in each place it applies. A flow is bound to a browser login at the realm level, but a client can override that binding with a different flow, so a realm can look correct in its flow settings while a specific client still signs administrators in without a second factor. Before writing any configuration steps, confirm the current binding and override behavior in the Keycloak server administration guide for the version you run, and record which flow each admin client actually uses. Then check the effective result for every realm and client on your list, not only the one you changed.

Testing with a non-admin account does not prove the admin path is protected. Ordinary users typically sign in through application clients and the account flows, so a pass with a standard user says little about the flow an administrator hits when opening the admin console. Test with dedicated administrator accounts in each realm and in the master realm, from the same networks and browsers your administrators use, and confirm that the second factor is demanded and that a password alone does not reach the console. Keep these test results with the configuration record, since they are the evidence that the admin flow was checked where it applies.

Where admin MFA fails in practice and how to close each gap

Admin MFA usually fails at the edges rather than in the main login form. The cards below cover the paths that skip a second factor, the endpoints that bypass the browser, and the recovery and session habits that quietly undo an otherwise strict policy. Each card names the control to apply and what to verify before you call the setup enforced.

Flow override that skips the second factor

A custom browser flow, a per-client override or a copied flow can leave the OTP or WebAuthn step out of the path an administrator actually takes. Review every flow binding in the master realm and in each administered realm, and confirm which flow each client uses. Then test sign-in as an administrator from a clean browser session and check that the second factor is required, not optional. Record the flow name and bindings as evidence for the assessor. Ask the team who can change flow bindings, since that permission is itself an admin control.

Admin API access with a token that bypasses login

The Administration REST API accepts bearer tokens, so a service account or long-lived token can perform admin actions without any browser-based MFA. Inventory every client with service account roles or admin-level roles, and remove those that do not need them. Restrict the admin API to the admin hostname and to trusted networks, and confirm that token lifetimes for admin-capable clients are short. Verify by attempting an admin API call with a token issued to a non-admin client and confirm it is refused.

Keycloak docs

Admin console reachable on the public hostname

If the admin console and Administration REST API share the hostname used for public sign-in, anyone who can reach the login page can reach the admin login. Follow the production guidance to serve the admin console and admin API on a different hostname or context path from public frontend URLs. At the reverse proxy, restrict paths so that only the admin hostname routes to admin endpoints, and allow access only from approved networks. Verify by requesting admin paths through the public hostname and confirming they fail, and that TLS is enforced on both hostnames.

Production guide

Shared or unmanaged recovery account

A bootstrap or break-glass administrator with a shared password and no enrolled second factor is the most common way admin MFA is bypassed on purpose or by accident. Keep one emergency account, give it a named owner, enroll a phishing-resistant factor on a dedicated device, and store recovery material under dual control. Define who may reset its credentials and log each use. Verify on a schedule by testing that the account signs in only through the expected path and that its factor still works. Confirm the procedure against your own identity policy, since the exact steps depend on your environment.

Weak OTP settings on admin accounts

Admin accounts that use a TOTP authenticator with permissive settings can be phished or replayed more easily than hardware-backed factors. Review the OTP policy for algorithm, digits, period and look-ahead, and decide whether TOTP is acceptable for administrators at all. Where your requirement calls for phishing-resistant authentication, require WebAuthn security keys for admin roles through a dedicated authentication flow. Verify by reviewing the effective policy and by confirming that an admin account cannot enroll a weaker factor than the one your policy names.

Sessions that outlive a role change

When an administrator loses an admin role or is disabled, existing sessions and refresh tokens can keep working until they expire. Set session and token lifetimes for admin clients deliberately, and revoke active sessions as part of the offboarding and role-change process. Confirm that removing a role takes effect on the next token issued, and that the admin console session ends. Verify by changing the role of a test administrator and checking that the old session no longer performs admin actions.

Setup sequence for enforcing admin MFA

This sequence moves Keycloak administrators from password-only sign-in to a phishing-resistant second factor in a controlled order, so no administrator is locked out and no admin path is left without MFA. Each step closes with a check you can record as evidence.

  1. Inventory every administrator account

    Before changing anything, list every account that can administer Keycloak. Cover the master realm, every other realm, the bootstrap admin, and any service accounts or clients with realm-management roles. For each account, record the realm, the roles it holds, who uses it, and whether it has a second factor today. Confirm the exact role names and the admin console location against the Keycloak 26.8 server administration guide. The step is done when the inventory is reviewed by the security owner and every realm has a named list of admins. Keep this list, because it becomes the enrollment population and later the audit evidence.

  2. Choose the phishing-resistant second factor

    Decide whether administrators will use WebAuthn security keys, platform passkeys, or OTP authenticator apps. WebAuthn and passkeys bind the login to the origin of the Keycloak console, which is the property that makes them phishing-resistant. OTP codes can be typed into a fake page, so treat them as weaker for this population. Record the decision, the accepted authenticator types, and any device that must be supported, such as shared workstations or hardware keys issued by the organization. Written sign-off from the CISO or security lead closes the step, and the decision record becomes part of your control evidence.

  3. Configure required actions and the WebAuthn policy

    In each realm, set the WebAuthn Register or passkey required action so administrators are prompted to enroll, and configure the WebAuthn policy settings that match your decision, including attestation, authenticator attachment, user verification, and allowed authenticators. Confirm the policy field names in the 26.8 server administration guide before you change them. If you chose OTP instead, set the OTP policy and the Configure OTP required action. The check is a test user in a non-production realm who is prompted to enroll on first sign-in and whose stored credential type matches the policy you set.

  4. Bind and test the administrator flow in each realm

    Create or copy a browser flow for administrators that requires the password and then the chosen second factor, and bind it as the browser flow for the realm that hosts admin accounts. Apply this in the master realm and in every other realm that has admin users, because each realm has its own flow bindings. Test with a dedicated test admin in each realm. The check is that the test admin is prompted for the second factor after the password, and that the flow shown in the admin events or login logs matches the flow you bound. Do not apply the change to all realms at once without this per-realm test.

  5. Enroll existing administrators in a controlled window

    Schedule a window with the administrators on the inventory. Ask each one to sign in, complete the required action, and register a primary security key and a second key or recovery method as your policy allows. Have a second administrator on hand to confirm identity for anyone who cannot complete enrollment, and record each exception with its owner and due date. Keep the bootstrap admin and break-glass accounts out of the first enrollment batch until their recovery path is tested, and handle them in step six. The step is done when every admin on the inventory shows a registered credential or a documented exception.

  6. Handle the bootstrap and break-glass accounts

    Decide how the bootstrap admin and any break-glass account will sign in once MFA is enforced. Options include keeping a hardware-backed credential in a sealed custody process, or binding a separate, documented break-glass flow that is used only under incident conditions. Test that the break-glass path works in a non-production environment and that the recovery steps are written down and reviewed. Confirm the current bootstrap and recovery procedure in the Keycloak operations documentation before you finalize it. The step closes when a recovery drill has been run and recorded, so you know the path works before you need it.

  7. Verify that sign-in without the second factor fails

    Run negative tests against each realm and the admin console. Attempt a password-only sign-in for a test admin, an admin whose credential has been removed, and a login through any direct grant or other flow that could bypass the browser flow. Confirm that each attempt is refused, and that the admin events or login failures show the expected result. Repeat the test after any change to flow bindings or client settings. Save the test cases, timestamps, and results as evidence. The step is done when every negative test fails as expected and the results are filed with the change record.

Break-glass and bootstrap-admin recovery without an MFA bypass

The bootstrap administrator and any break-glass account must sit under the same MFA policy as every other administrator, or under a documented exception that is narrow, monitored and reviewed. The recovery path is itself a privileged login, so an account that skips the second factor becomes the easiest route into the master realm. Decide the policy first, then design the recovery around it. Confirm the current bootstrap-admin behavior for your chosen Keycloak version in the server administration guide before you write the procedure, because initial admin creation and its settings have changed across releases and the procedure must match the version you deploy.

Avoid a recovery path that depends on one person's phone. Use at least two break-glass accounts or two independently held WebAuthn security keys enrolled to separate custodians, and register both keys before the realm goes into production. Store the recovery credentials in a sealed, access-logged vault that two people can open under documented conditions, and rotate them after every use and on a fixed schedule set by your security policy. Recovery codes for the break-glass accounts should be generated at enrollment, printed or stored offline, and marked used when consumed. Admin reset of a second factor belongs in the same runbook, but the full lost-device process is covered in the MFA recovery topic.

Record every use of a break-glass account as a security event. Forward Keycloak admin and login events to your log platform, alert on any login by the break-glass accounts, and require a ticket that names the reason, the approver and the actions taken. Test the path in a non-production realm at least once before go-live, and retest after each upgrade. Auditors will ask for the enrollment record, the custodian list, the rotation history and the usage log, so keep those artifacts together. Ask your implementation partner and your auditor to agree the exception wording in writing before the production cutover.

How enrollment differs for platform, realm and help desk administrators

Platform operators hold access to the master realm, which can create realms, change global settings and reach every tenant. Their enrollment should be the strictest in the deployment, and it should happen before they receive any broad permissions. The usual pattern is to create operator accounts through a controlled process, require a phishing-resistant factor such as a passkey or hardware security key during the first sign-in, and keep the number of accounts small enough that each one can be reviewed by name.

  • Enrollment method: Register a WebAuthn credential, preferably a hardware security key or a platform passkey, and disable fallback to a password-only path for these accounts.
  • Required action: Attach the WebAuthn enrollment required action to the account so sign-in cannot complete until the credential exists.
  • Reset verification: Confirm the identity of a lost-key request through a second channel and an approval from another operator before any credential is removed.
  • Support load: Expect low volume but high sensitivity. Each reset is a privileged change, so plan a written record for every request.
  • Break-glass linkage: Keep the bootstrap or emergency account outside daily use and document how its credentials are stored and tested.

Confirm with your own policy whether operators should also be bound to specific source networks or a reverse proxy path before you finalize the enrollment design.

What evidence auditors ask for on administrator MFA

Auditors testing administrator MFA want proof that the control exists, covers every administrator, and has not quietly changed. The evidence a compliance team usually requests is a list of administrator accounts with the second-factor method each one uses, an exported authentication flow and the required action configuration that enforces it, change records for every flow binding in the master realm and per-realm admin flows, admin login events that show the authentication method used, and records of recovery and credential resets, including who approved them. DeployOpen prepares these artifacts and the configuration behind them, but it does not issue audit reports or attestations. Independent auditors decide what is sufficient for their assessment, so ask the auditor early which samples and time periods they will test.

Some of this data depends on how the server is run. Event recording and admin event logging must be switched on before the period under review begins, and metrics such as those exposed at /metrics when --metrics-enabled=true is set help with monitoring but are not an audit trail on their own. Confirm with the vendor documentation for your exact version which event types are recorded, whether login events include the authentication method or only the outcome, and how long events are retained in your database. Keep an exported copy of the realm configuration with each change, since the server does not give you a history of flow edits by default. Where an event type is not recorded, plan a compensating control such as a reviewed change ticket and a periodic export, and document it openly rather than presenting it as automatic.

The practical step is to rehearse the evidence pack before an auditor asks for it. Pull the administrator list from the realm, match each account to a registered WebAuthn or OTP credential, export the flow and required action settings, and trace one recent recovery event from the request to the credential reset. Note any gap, such as an administrator with a password-only sign-in or a bootstrap account that was used outside the documented break-glass procedure. These gaps are easier to explain when you found and closed them yourself. Agree the format and storage location of the pack in the written scope, since the artifacts need to be retained and shown in the same form each time the control is tested.

What to confirm in your environment before relying on admin MFA

An MFA requirement on the Keycloak admin console only protects what it covers. The cards below list the administrator paths, service accounts, upstream identity controls, release line and distribution choices that decide whether the requirement holds in practice and whether auditors will accept the evidence.

Every administrator path

Confirm which paths reach administrative power: the admin console, the Administration REST API, operator-managed custom resources and any scripts that call the API. An admin browser flow that requires a second factor does not stop a token issued to a script or a client that can change realms. List each path, name the control that enforces the second factor on it, and test each one with an account that has no OTP or WebAuthn credential. Expose the admin console and Administration REST API on a separate hostname or context path from public frontend URLs, as the production guide recommends, so that the network boundary matches the authentication boundary.

Keycloak production guide

Non-interactive service accounts

Automation such as backup jobs, provisioning pipelines and monitoring probes often authenticates with a client credentials grant, which has no user present to answer a second factor. Identify every service account that holds admin roles, decide whether it should hold those roles at all, and document the compensating controls: a narrowly scoped client, a short token lifetime, a secret or key stored in a vault and a documented owner. Confirm that these accounts are excluded from the interactive MFA flow on purpose, so that an exception does not quietly become a bypass for human users.

Upstream identity provider MFA

If Keycloak brokers logins to an external identity provider, the second factor for administrators may be enforced there, not in Keycloak. Confirm which provider authenticates each administrator, whether it enforces phishing-resistant factors, and whether Keycloak trusts its authentication context or re-prompts locally. Also check how group or role claims from that provider map to Keycloak admin roles, because a mapping error can grant admin rights to an account that never passed the factor you intended to require. Document the answer in the same control matrix as the Keycloak flows.

Keycloak version and upgrade cadence

Administrator flows, required actions and WebAuthn settings can change between releases, so the evidence you collect must match the version you run. The current release is 26.8.1, published October 13, 2026. Keycloak plans four minor releases a year, and breaking changes in a minor release are opt-in. Confirm which minor line your team will track, who applies updates, whether the Operator runs in manual approval mode, and how you will retest the admin MFA flow after each upgrade. Re-running the same test cases after each change keeps the evidence current.

Keycloak release updates

Community release or Red Hat build

Decide whether you run the upstream community release or the Red Hat build of Keycloak, which Red Hat describes as its supported distribution based on the open source project and as the replacement for Red Hat Single Sign-On. The two may ship on different version lines and with different support terms, so the version you test must be the version you deploy. Ask the vendor which release line, support window and security errata process apply, and do not assume that community documentation describes the supported behavior of the Red Hat build.

Red Hat build product page

Questions buyers ask about enforcing Keycloak admin MFA

What does enforcing MFA for Keycloak administrators cost?

No fixed price applies, because the cost follows from the written scope. The main drivers are the number of realms that have administrators, the number of administrators and their roles, whether Keycloak already federates users from Active Directory or another directory, how the reverse proxy separates the admin console from public URLs, and how much evidence the auditors will expect. Each of these adds configuration, testing and documentation work. DeployOpen does not publish a price list, so ask for a fixed-scope quote that lists the realms, the admin population, the flows to change, the break-glass procedure to build and test, and the evidence to deliver. Most engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.

How long does an admin MFA enforcement project take?

Duration depends on the same drivers as cost: realm count, administrator count, federation, proxy configuration and evidence scope. A single master realm with a small admin group is a much smaller job than a multi-realm estate with directory federation and a required recovery procedure. Ask for a timeline in the written scope rather than relying on a generic figure, and ask how enrollment of existing administrators will be scheduled so that no one is locked out during the change. Verification, including a tested break-glass path, should be counted as part of the timeline, not added afterward.

What must our internal team provide before the work starts?

Your team should provide an inventory of Keycloak realms and the people who administer each one, the current authentication flows and any custom authenticators, the hostnames and reverse proxy configuration for the admin console and Administration REST API, and the identity sources behind Keycloak. You also need a named owner who can approve changes to the master realm and who can confirm which administrators need a phishing-resistant second factor, such as a FIDO2 security key or a passkey. Agree on who holds the bootstrap and break-glass credentials, where they are stored and who may use them. Finally, identify the audit or assessment that the evidence must support, so the evidence scope is fixed early.

Can our own team enforce admin MFA without a partner?

Often yes, if your team already runs Keycloak in production and has the skills to change authentication flows, required actions and the reverse proxy. The risk lies in the sequence. A change to the master realm can lock every administrator out if a required action is applied before enrollment is complete and a recovery path exists. Teams that build the work themselves should test in a non-production realm first, keep the bootstrap administrator documented and tested, and record evidence as they go. A partner is most useful when the estate spans several realms, when no one on the team has tested break-glass recently, or when the evidence must match a specific assessment.

How is break-glass access tested without weakening admin MFA?

Break-glass access should be tested with a controlled drill that uses the documented recovery path, then recorded and reviewed. Keycloak's bootstrap administrator and the recovery procedure for administrator credentials should be exercised in a non-production copy first, confirming that the account can sign in with its intended second factor or sealed recovery method and that its use raises an alert. Test that the account cannot be used silently, that its credentials are stored under dual control, and that the credential is rotated after each drill or real use. The test results, dates, participants and any fixes become part of the evidence pack. Confirm the exact procedure against your Keycloak version in its administration documentation before finalizing it.

What changes after a Keycloak upgrade, and what should we re-test?

Upgrades can change flows, required actions, default behavior and the admin console, so MFA enforcement should be re-tested after each one. Keycloak ships minor releases several times a year, and the upgrade notes for each release list behavior changes that can affect authentication. The current release at the time of writing is 26.8.1, and its upgrade notes include changes to SMTP and token validation, so check the notes for your target version. Re-test that every admin still has a working second factor, that the admin console hostname is still restricted, that the break-glass account still works, and that audit logging still records admin sign-ins. Ask whether the scope includes retesting after upgrades, since this is often offered as an ongoing retainer.

What evidence should we expect from an admin MFA project?

You should expect the configuration and the proof that it works. That typically includes the exported authentication flow and required action settings, the list of administrators with their enrolled phishing-resistant factors, the proxy rules that separate the admin console and Administration REST API from public frontend URLs, the audit logging configuration, and the break-glass test records. DeployOpen prepares systems, controls and evidence for compliance assessments, but it does not issue audit reports, attestations or certifications. Independent auditors and certification bodies make those determinations, so agree with your auditor in advance on which artifacts they will accept.

How DeployOpen scopes and delivers Keycloak admin MFA

DeployOpen treats administrator MFA as a written scope with defined realms, flows, recovery paths and evidence, agreed before any change is made to a production Keycloak. The work is delivered inside your own infrastructure, so your security and compliance teams review the same configuration that runs in production.

How we scope

  • Inventory every realm, client and admin account that can change identity configuration today.
  • Agree in writing which admin consoles, master realm and per-realm roles must require a phishing-resistant second factor.
  • Define the break-glass account, recovery owners and the evidence your auditors will ask to see.

How we build

  • Configure browser flows and required actions so admin enrollment of a passkey or security key is enforced at first login.
  • Test each admin path, including the master realm, per-realm consoles and the Administration REST API, for any route that skips the second factor.
  • Rehearse break-glass and bootstrap-admin recovery in a non-production realm before the change reaches production.

How we hand over

  • Document the flow configuration, WebAuthn policy, required actions and recovery steps as a runbook your team can operate.
  • Deliver a test record showing each admin path tested, the expected result and the retest outcome.
  • Provide an evidence pack that maps configuration to your internal controls, which your auditors review independently.

How we support

  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
  • Ongoing support, upgrade testing and continuous security testing are available as a retainer.
  • Confirm with your team how Keycloak upgrades, including minor releases, will be retested against the admin MFA flows.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.