Keycloak MFA, WebAuthn and passkeys

How to add OTP, WebAuthn security keys, passkeys and recovery codes to a self-managed Keycloak realm, apply conditional authentication, and roll MFA out without locking users out.

On this page

How Keycloak MFA, WebAuthn and passkeys fit into a sign-in rollout

A self-managed Keycloak realm that signs in users with only a password needs a stronger second factor, and the work to add one is larger than the setting that switches it on. Keycloak supports one-time passwords (OTP) from an authenticator app, W3C WebAuthn security keys, and passkeys that can be used with conditional and modal sign-in prompts. These are different credentials with different trade-offs. OTP is a shared secret that the user types in, so it is widely supported but phishable. WebAuthn security keys are hardware-bound public key credentials tied to a device the user carries. Passkeys are discoverable WebAuthn credentials that can sync between a user's devices, which makes them easier to adopt but changes what you must trust about the user's account recovery path. Your rollout has to decide which of these factors each population may use, and whether any of them satisfies a stronger requirement on its own.

The hard parts are enrollment and recovery, not the authentication step. A user who has never registered a factor, loses a phone, or replaces a security key will be locked out the moment you require MFA for everyone. Keycloak offers recovery codes and OTP policies, but the realm still needs a decision on who can reset a factor, how the help desk verifies identity before doing so, and whether users are forced to enroll at next sign-in or given a grace period. Conditional authentication flows let you require MFA only for sensitive clients, unfamiliar networks or privileged roles, which reduces disruption, but every condition is another path to test and another place a user can get stuck.

This is therefore a cross-team change, not a single toggle. Realm configuration defines the required actions, authentication flows and credential policies. Client settings decide which applications request which assurance and whether they accept the result. User communication explains what each user must register and by when. Support processes cover identity verification for resets, the runbook for lost devices and the escalation path when enrollment fails. Confirm early with your identity, application and service desk owners who will handle each of these, and check the exact credential options and flow behavior for your Keycloak version in the server administration guide before you finalize the design.

Which Keycloak settings and authentication components are involved

Keycloak MFA is not one switch. It is a set of realm policies, user credential types, required actions and authentication flow steps that have to agree with each other. Each card below is a component your team will configure, and the order you touch them determines whether users can enroll and sign in without help desk tickets.

OTP policy

The OTP policy in the realm sets how time-based one-time passwords are built, including the algorithm, digit count, period and the look-ahead window that tolerates clock drift on user devices. Changing these after users have enrolled authenticator apps can break existing enrollments, so settle the values before the first rollout. Check which authenticator apps your users run and confirm they support the settings you choose. Treat OTP policy changes as a migration event, not a tweak.

Keycloak server admin docs

WebAuthn policy for security keys

The WebAuthn policy governs hardware security keys registered as second factors, covering settings such as the relying party name, attestation preference, user verification and which authenticator types are allowed. A separate WebAuthn passwordless policy exists for keys used as the primary sign-in method. Decide early whether you need attestation, since it adds verification work and can exclude some keys. Confirm the exact options in the admin console for your release.

Passkey support with conditional and modal UI

Passkeys are WebAuthn credentials that can sync across a user's devices. Keycloak's login pages can offer them through conditional UI, where the browser suggests a saved passkey in the username field, or through a modal prompt. Test both paths in each browser and device combination your users rely on, because browser support and password manager behavior differ. Passkey enrollment and sign-in should be tested on managed devices before you promise coverage to any user group.

Recovery codes

Recovery codes are single-use backup codes that let a user sign in when the primary second factor is lost. Decide who can generate them, how many codes are issued, and whether users see them only once. Your help desk procedure must explain how a user with no codes and no device regains access, including how identity is verified before a credential is reset. Without this, recovery codes are the first thing users lose.

Required actions

Required actions tell Keycloak to force a user through a step at next sign-in, such as configuring OTP or registering a WebAuthn credential. Assigning them to a user or group is how you roll MFA out in waves rather than all at once. Pair them with a grace period or a set of pilot users so enrollment does not block the whole directory on day one. Verify how required actions interact with users who are federated from LDAP or Active Directory, since those users may have credentials managed elsewhere.

Authentication flow where MFA attaches

The browser authentication flow decides when a second factor is challenged. Keycloak lets you add conditional sub-flows so MFA runs only for certain clients, roles, or contexts, instead of every login. Start from a copy of the built-in browser flow, keep it in a test realm, and walk through each path with a test account. Conditional logic that is wrong fails open or locks people out, so review it as a security control with the team that owns the policy.

Choosing between OTP, security keys, passkeys and recovery codes

This table compares the four second factor and recovery options Keycloak can offer, across device needs, enrollment, recovery, support load and phishing resistance. Read each row as a qualitative trade-off that your identity team should confirm against its own user population and Keycloak version before setting policy.

FactorWhat users needOperational costPhishing resistance
OTP (authenticator app)A smartphone or app that generates time-based codesLow enrollment effort, but lost or replaced phones drive help desk ticketsLow to moderate, since a user can still type a code into a fake sign-in page
WebAuthn security keysA hardware FIDO2 key and a port or NFC reader that fits itKeys must be issued, tracked and replaced, which adds logistics and cost to the rolloutHigh, because the key is bound to the site origin
PasskeysA device or password manager that supports passkey storage and syncEnrollment is simple for most users, but sync scope and device changes need a clear recovery pathHigh, because the credential is bound to the site origin
Recovery codesA safely stored set of single-use codesLow to deploy, but users who lose the codes depend on an admin to reset their factorNot a phishing control on its own, since codes can be typed into a fake page
Several factors per userUsers enroll more than one methodAllows fallback when one device is lost, but increases support questions about which method to useStrength depends on which factor is used at sign-in, so policy should set the minimum
Passkeys versus passwordsUsers accept passkeys as a sign-in method alongside or in place of passwordsSupplementing passwords is the lower-risk rollout, while replacing them needs tested recovery and admin reset stepsReplacing passwords removes the password phishing path, but only where passkeys are required

How to configure MFA in a Keycloak realm, step by step

This sequence takes a non-production realm from a password-only sign-in to a tested MFA design with OTP, WebAuthn security keys, passkeys and recovery codes, so the team can roll enrollment out to users in controlled stages without locking anyone out.

  1. Confirm the realm and client scope

    Identify the realm, the clients that will require a second factor, and the user groups or roles that will be in scope first. Create or clone a non-production realm that mirrors production clients and redirect URIs, so changes can be tested without touching live sign-in. Confirm which applications use the browser login flow and which use direct grants or APIs, because those paths handle second factors differently. The check: a written list of in-scope clients and a test realm that signs in to at least one test client.

  2. Set the OTP policy

    In the realm settings, open the OTP policy and choose the OTP type, algorithm, digit count and period that your authenticator app support requires. Keep the defaults unless your security standards or the apps in use require something different, and confirm each choice with the apps your users actually run. The check: a test user adds a time-based one-time password to an authenticator app in the test realm and the code is accepted at sign-in.

  3. Set the WebAuthn policies

    Configure the WebAuthn Register and WebAuthn Passwordless Policy sections separately. Set the relying party settings, attestation preference, authenticator attachment (platform or cross-platform), user verification and resident key requirements to match the hardware you plan to allow. Document which settings apply to second-factor security keys and which apply to passkeys, since they are configured in different policies. The check: a test user registers a security key under the WebAuthn Register policy and the key appears on the user's account.

  4. Enable passkeys in the realm

    Turn on passkey support for the realm and confirm the passkey sign-in option appears on the login page in the browser flow. Verify that the browser supports conditional UI and modal UI in your test matrix, because the sign-in experience differs between them. Confirm the realm's domain and hostname match what browsers will see, since passkeys are bound to the relying party. The check: a test user creates a passkey on a test device and signs in with it without typing a password.

  5. Build or adjust the browser authentication flow

    Duplicate the built-in browser flow, then add the OTP and WebAuthn executions as alternatives or required steps according to your design. Use conditions where the second factor should apply only to certain users, groups or clients, and keep the password step ahead of the second factor. Bind the copied flow as the realm browser flow only after it passes testing. The check: a test user with no enrolled factor is sent to enrollment, and a test user with an enrolled factor is prompted for it, in the flow diagram and in a real sign-in.

  6. Configure recovery codes

    Enable the recovery codes option in the realm's authentication configuration and set the flow so users are offered codes after their first factor is enrolled. Plan how users regenerate or revoke codes and how an administrator verifies identity before resetting a second factor. Record the support procedure that handles users who lose every factor. The check: a test user generates recovery codes, uses one to sign in without the primary factor, and the used code cannot be reused.

  7. Set required actions for enrollment

    Assign the relevant required actions, such as configuring OTP or webauthn registration, to the test users or groups so enrollment happens at next sign-in rather than by email campaign. Decide whether enrollment is mandatory or optional during a rollout period, and make that decision in the same place where the conditional flow is set so the two do not conflict. Confirm that the account console lets users manage their own factors. The check: a test user without a factor is required to enroll at sign-in and reaches the application afterward.

  8. Test the full path before production

    Run a scripted set of cases in the test realm: new user enrollment, existing user sign-in, lost factor with recovery code, lost factor with administrator reset, and a user in an excluded group. Record results and fix flow gaps before exporting the realm configuration to production through your normal change process. Ask the team that operates Keycloak to confirm how the export and import will be reviewed and approved. The check: every test case has a recorded pass result and a named owner for the production change.

How conditional authentication decides when to ask for a second factor

Conditional authentication in Keycloak decides, per sign-in, whether a second factor is required, so teams can ask for OTP, a WebAuthn security key or a passkey only where the risk justifies the extra step. In practice this means building an authentication flow that contains a conditional sub-flow, and binding that flow to the clients or realm bindings that need it. The decision depends on conditions evaluated during the login, such as the user's roles or groups, the client being accessed, or other signals your Keycloak version exposes. Before you design around any condition, confirm which conditions your exact Keycloak version supports, which ones are built in and which need a custom authenticator, and how each behaves when the user has not yet enrolled a second factor. Check this against the server administration guide for your release and against a test realm, not against memory of an older version.

The most common design is step-up for sensitive clients: a low-risk portal signs in with the password alone, while an administrative console or a payments-facing client requires a second factor on every sign-in or after a defined session condition. Map this to a client or group condition in a test realm, then confirm that the sensitive client triggers the second factor and the low-risk client does not. Also decide what happens when a user in scope has no enrolled factor. A required-action approach forces enrollment, while a denial blocks access, and each has a support cost. Illustratively, if a finance group is required to use a security key, a user who has not registered one should be routed to enrollment rather than silently signed in without a second factor.

The main risk is a gap: a second factor that is skipped because a condition is evaluated against the wrong attribute, because a client sits outside the flow binding, or because a legacy protocol path or token exchange bypasses the browser flow entirely. Test every entry point the sensitive application exposes, including direct grants, API access and any second client that shares the same backend. Record the test cases, rerun them after each Keycloak upgrade, and keep the flow definitions under change control. Ask any partner or internal team to show a negative test for each gap, not only a passing login.

Rolling MFA out to users without locking them out

The pilot shows whether enrollment works in your environment before any user depends on it. Choose a small group that includes application owners, help desk staff and users on each device type you support. Run the pilot in a non-production realm, or in a production realm with one test client, and apply the second factor to the pilot group only.

  • Enrollment window: Set a fixed period in which pilot users register a passkey, security key or OTP app, and record how long each step takes.
  • Grace period: Assign the Configure OTP or WebAuthn register required action to pilot accounts so users can finish enrollment at their next sign-in without being blocked today.
  • Help desk script: Write the steps for removing a lost factor, verifying identity before a reset and re-enrolling the user, then rehearse them with the pilot team.
  • Communication: Tell pilot users which device to bring, what the sign-in screen will show and who to contact, and collect their feedback at the end of each day.
  • Rollback path: Keep the password-only flow available for the pilot group until exit criteria are met, and document who can revert the required action and how.

Before leaving the pilot, confirm that every pilot user has a second factor registered and that the help desk has completed at least one reset from start to finish.

What drives MFA rollout effort and how to keep it down

This table lists the main factors that change how much work an MFA rollout takes in Keycloak, and what each one asks of your team. Read each row as a driver with a practical way to narrow it before go-live. The main takeaway is that most effort comes from user and device variety, help desk readiness and login screen customization, so settle those early.

DriverWhy it changes effortHow to keep it down
User count and device diversityEach group of users with different phones, security keys or computers needs its own enrollment path and test cases. Users without passkey-capable devices need OTP or security key options.Start with a pilot group that covers your device mix. Offer two or three factor types so no one depends on a single device.
Clients needing step-upEach client that requires a stronger authentication level adds a flow binding, a test case and a support question. Overlapping requirements multiply the testing.Define one or two step-up levels centrally and apply them by client role or group rather than configuring every client separately.
Realms and environmentsEvery realm and each environment (development, test, production) repeats flow, policy and login screen configuration. Drift between them causes surprises at cutover.Export realm configuration as code, promote it through environments, and keep one reviewed source of truth for MFA settings.
Help desk process for lost devicesLost phones and keys generate most post-launch tickets. Without a verified recovery path, support staff must reset factors by hand, often without a standard identity check.Write the identity verification steps, issue recovery codes at enrollment, and train staff on removing a single factor rather than disabling MFA for the account.
Custom login themesNew screens for enrollment, factor selection, passkey prompts and recovery code display must exist in every theme and language you support. Custom themes must be retested after each Keycloak upgrade.Keep theme changes minimal, reuse the standard MFA screens where possible, and include them in your upgrade test plan.
Compliance evidence requirementsAssessors often ask for policy settings, enrollment records, exception approvals and proof that MFA was enforced for the intended users. Collecting this after the fact takes significant time.Confirm with your assessor which evidence they expect, set up admin event logging early, and record exception approvals as they happen.

How a Keycloak sign-in moves through the second factor

The sign-in starts when a user opens an application that redirects to the Keycloak browser authentication flow. Keycloak checks the password first, then evaluates conditions such as the client or role to decide whether a second factor is required. The user answers with a one-time code, a WebAuthn security key or a passkey, and only then does Keycloak issue tokens to the application. The recovery code path branches off the second factor step, so a user who has lost the device can still finish sign-in. Check that conditions, enrolled factors and recovery codes are tested together before rollout.

Second factor selection and recovery code branch in a Keycloak browser flow.

Where passkeys and WebAuthn behave differently in production

Passkeys and WebAuthn credentials are bound to a relying party ID, and in Keycloak that ID is derived from the public frontend hostname. A credential registered under one hostname will not work after the realm moves to another, for example when a test host, a regional alias or a reverse proxy rewrite changes the name users see in the browser. Before rollout, fix the frontend URL, decide whether any subdomain will ever share credentials, and confirm how the reverse proxy forwards host headers to the Keycloak instance. Changing the hostname later usually means asking users to register their authenticators again, so treat it as a one-way decision for each realm.

Support differs by browser, operating system, password manager and authenticator, and it changes over time. Some platform authenticators sync passkeys across a user's devices through a vendor account, while hardware security keys stay on one device and need a registered backup. Cross-device sign-in, where a phone approves a sign-in on a laptop, depends on the browser and the device pairing flow. Confirm current browser and authenticator support against the vendor documentation and the Keycloak server administration guide at the version you run, and record which combinations your users actually have.

Test with real authenticators, not only the browser developer tools virtual authenticator. Build a test matrix that covers each target browser, each device type your staff and customers use, at least one roaming security key, and the fallback path when the authenticator is lost. Check the conditional and modal sign-in UI, the registration flow from the account console, and the recovery codes path on each. Keep the matrix with the realm configuration so that any change to the frontend URL or the authentication flow triggers a repeat run before production.

Hardening MFA settings, recovery and secrets

MFA raises the bar only if the paths around it are protected too. Recovery codes, the admin console, transport security, brute force defenses and logs all decide whether a second factor can be bypassed. Review these areas together before users are enrolled at scale.

Protecting recovery codes

Recovery codes let a user regain access when a phone or security key is lost, so each unused code works as a full sign-in. Decide who may generate and regenerate codes, how users store them, and whether a code reset requires a fresh password check. Confirm in your environment that codes are shown once, that reuse is blocked, and that help desk staff cannot view existing codes.

Keycloak docs

Admin console on a separate hostname

The admin console and Administration REST API should not share a hostname or context path with public sign-in pages. Keeping them apart lets you restrict admin access by network path and reduces the chance that a public-facing rule exposes administrative functions. Check that your reverse proxy blocks admin paths on the public hostname and that admin accounts require MFA.

Production guide

TLS on all communication

MFA secrets, OTP seeds, WebAuthn responses and session cookies all cross the network during sign-in. Keycloak's production guidance calls for TLS on every hop, including between the reverse proxy and Keycloak, and for the database connection where your platform supports it. Verify certificate handling and confirm that no internal component falls back to plain HTTP.

Brute force protection and MFA

Brute force detection should count failed second-factor attempts as well as failed passwords, so an attacker cannot guess OTP codes without limit. Tune lockout thresholds and wait times against your help desk volume, since aggressive lockouts create the support load that leads to MFA being disabled. Test both a locked account and a user with a lost device before rollout.

Auditing failed login events

Failed logins, OTP failures and WebAuthn errors are the signals that show an attack in progress or a broken enrollment. Confirm that login failures are stored and forwarded to your SIEM, and that alerts distinguish password failures from second-factor failures. Keycloak 26.8 persists login failures to the database by default, so plan retention and storage for that data.

Upgrade notes

Keeping OTP secrets out of logs

The OTP seed behind an authenticator app is as sensitive as a password. Check that debug logging, support tickets, realm exports and screenshots do not contain seeds or enrollment QR codes. Review who can export realms or view user credentials, and confirm that log pipelines redact credential fields before data leaves the Keycloak host.

How to test MFA so it works and fails safely

Test every second factor path before any user is asked to enroll, because MFA failures in Keycloak usually show up as lockouts rather than errors. Build a test matrix in a non-production realm that mirrors production: one case per factor (OTP authenticator app, WebAuthn security key, passkey, and recovery codes) covering enrollment, a successful sign-in with the factor, a sign-in without it where the required action should block or prompt, and a failed attempt with a wrong code. Run each case with a test user and record the realm, client, authentication flow and Keycloak version used, so the result can be repeated after an upgrade.

Next, test the cases that decide whether users can get back into their accounts. Use a recovery code once and confirm it is consumed, then confirm a second use is refused. Simulate a lost device by removing the user's OTP or WebAuthn credential from the admin console, and check that the helpdesk procedure, the user's ability to re-enroll and any notification emails behave as your runbook says. For conditional step-up, confirm that a protected client prompts for the second factor under the condition you configured (for example, a sensitive scope or a higher-risk login), and that a low-risk login on the same client does not. Confirm which authentication flow each client uses, because a client bound to the wrong flow skips the check silently.

Then test the failure modes. Decide, and test, what happens when the second factor service path is unavailable, such as an external OTP or SMS provider, a mail relay used for notifications, or a network route to a hardware token service. Confirm whether the flow fails closed (sign-in denied) or fails open, and whether that behavior matches your risk decision. Keep the results as dated, signed test records with the expected and actual outcome for each case. Auditors and security reviewers will ask for this evidence, but DeployOpen prepares the evidence and does not issue any audit opinion. Confirm the retention period with your compliance lead.

What to monitor, back up and document after MFA goes live

This table pairs each operational area with what to watch or keep, and what a reviewer or help desk will need to see. Read it as a checklist for the first months after MFA is enforced, when lockouts and support calls are most likely. The main takeaway is that MFA is only as recoverable as the records and runbooks behind it.

AreaWhat to watch or keepWhy it matters after go-live
Login failure signalsFailed OTP, WebAuthn and passkey attempts by realm and client, tracked over time and compared with the rollout scheduleA spike after an enforcement date usually points to enrollment gaps, clock drift or a broken authenticator flow rather than attacks
Enrollment volumesUsers who have registered each factor, users still without any second factor, and users stuck mid-enrollmentShows how close the rollout is to its target and which groups need follow-up before the next enforcement step
Recovery code and help desk volumesRecovery code use, reset requests and the reason category recorded for eachRising counts often signal that users lost devices or that the enrollment instructions are unclear
Metrics at the management interfacePrometheus metrics at /metrics once started with --metrics-enabled=true, including optional HTTP request and cache histograms; confirm the exact metric names in your versionGives the monitoring team data to alert on login failures and latency, and it must be reachable only from the monitoring network
Realm configuration backupsExports of the realm, including authentication flows, OTP and WebAuthn policies and required actions, stored on a schedule with restore steps testedA bad flow edit can lock out every user, so a known-good export is the fastest way back
Change control for flows and policiesA record of who changed a flow, policy or conditional rule, why, and the test run that preceded itAssessors and incident responders need to see that authentication changes were approved and tested
Help desk recovery runbookIdentity checks before a reset, steps to remove or re-register a factor, when to issue recovery codes, and when to escalate to a security ownerPrevents social engineering of the help desk, which is a common path around MFA
Audit and event recordsAdmin and authentication events kept in the chosen store, with retention set by your own policy; confirm event storage options for your versionProvides the evidence trail for investigations and for compliance reviews of MFA controls

How long does Keycloak MFA take, what does it cost and can our team do it alone?

Can our internal team set up Keycloak MFA without a partner?

Yes, a team with Keycloak administration experience can usually configure OTP, WebAuthn and passkeys in a test realm alone, but the harder parts are policy design, rollout and support. The configuration itself is mostly admin console work: enabling required actions, setting OTP policies, registering WebAuthn policies and defining conditional authentication flows. The work that tends to stretch an internal team is deciding who must enroll and when, testing every sign-in path (browsers, mobile apps, API clients, legacy apps), and handling enrollment problems after launch. Ask yourself whether you have people who can own those steps for the months after go-live, not only for the first configuration.

What drives the cost of a Keycloak MFA rollout?

The main cost drivers are the number of realms, applications and user populations that need MFA, the sign-in flows each application uses, and how many user groups must be migrated in stages. Costs also rise when MFA must be added to a Keycloak instance that already has custom authentication flows or themes, because those need testing against the new steps. Other drivers are whether you have a test environment that mirrors production, how many helpdesk staff must be trained, and whether compliance evidence such as enrollment records and policy exports must be prepared. Costs are split between one-time work (design, configuration, testing, rollout) and recurring work (support, policy reviews and upgrade testing after each Keycloak release).

How long does a Keycloak MFA rollout take?

Duration depends on scope rather than on a fixed formula, so no timeline can be given without a written scope. The biggest variables are the number of applications and user groups, whether existing users are enrolled in waves or all at once, how many sign-in paths must be tested, and how much approval your identity, security and application owners need. Ask any partner or internal lead to break the plan into design, test, pilot, staged rollout and post-launch support, and to state the assumptions behind each phase. A pilot with a small user group usually reveals enrollment and recovery issues that would otherwise appear in production.

What must our team provide for a Keycloak MFA project?

Your team needs to supply decisions and access as much as people's hours. Identity owners must define which users, roles and applications require MFA and which methods are allowed. Application owners must confirm how each app signs in, whether it uses API clients or mobile flows, and which sessions must be re-verified. Help desk leads must agree enrollment and account recovery procedures and staff the first weeks after go-live. You also need a set of test users across roles and devices, a test realm or environment, access to the Keycloak admin console and reverse proxy settings, and a named approver for policy changes.

How does passkey setup differ from OTP setup?

OTP enrollment is a one-time authenticator app setup in which the user scans a code and then enters a time-based code at each sign-in, so the main risks are lost devices and recovery codes. Passkeys and WebAuthn security keys rely on public key credentials bound to a device or security key, and sign-in uses a platform prompt or key touch. In Keycloak, the server administration guide documents W3C WebAuthn, passkeys with conditional and modal UI, and recovery codes, so the configuration includes choosing which credential types are allowed, whether passkeys are passwordless or a second factor, and how users register more than one device. Passkey work also needs testing across browsers and operating systems, since support differs by platform, and you should confirm how your chosen Keycloak version behaves with each target client.

What should we confirm in a Keycloak MFA quote?

Ask for a written scope that lists the realms, clients, user groups and sign-in flows in scope, and the MFA methods to configure (OTP, WebAuthn, passkeys, recovery codes). Confirm which environments are included, whether test realms are built and handed over, and how rollout waves and pilot groups are defined. Check who performs enrollment support during the pilot, what the handover documentation covers, and whether conditional authentication rules are included. Ask how upgrades to later Keycloak releases are tested for MFA flows, whether any retainer covers that work, and what happens if a scope change is needed mid-project. Also ask for the assumptions and dependencies behind the fee, since those usually determine the final cost.

What goes wrong when MFA is rolled out without a recovery plan?

The most common failure is locking users out: a user who loses their only second factor cannot sign in, and if no recovery path exists, an administrator must reset enrollment manually. Other frequent problems include enforcing MFA on a client that cannot handle the extra step, such as a legacy app or API client, and rolling out to everyone at once without a pilot. Plan recovery codes, a documented helpdesk verification procedure, and an admin path for resetting credentials before any required action is enforced. Confirm that the help desk has tested these steps in the test realm, because enrollment resets are where lockouts usually surface.

How DeployOpen scopes, builds and hands over MFA work

The sequence turns an MFA goal into a written scope, a tested Keycloak configuration in your own environment, and a handover your team can operate without DeployOpen on the day it ends.

  1. Agree the written scope first

    Before any change, DeployOpen and your identity and security leads agree in writing which factors are in scope (OTP, WebAuthn security keys, passkeys, recovery codes), which realms and clients are covered, which user groups move first, and which conditional flows are required. The scope also names who approves each decision and what counts as done. The step closes when the signed scope lists the factors, realms, clients, user groups and acceptance criteria, and the quote follows from that document.

  2. Review current realm and sign-in state

    DeployOpen inspects the existing Keycloak realms, the authentication flows bound to each client, the password policy, brute force settings, and any user federation such as LDAP or Active Directory that affects where credentials and attributes live. The team also records which applications already rely on the browser flow and which ones use direct grants or APIs that MFA could break. The output is a short findings note listing each affected client and the change it needs before MFA can be enforced.

  3. Configure factors and enrollment in a test realm

    DeployOpen configures the required authentication factors in a non-production realm or environment: OTP policy, WebAuthn and passkey registration with the conditional and modal sign-in options, and recovery codes. Required actions and enrollment behavior are set so that users can register a factor at sign-in. The step closes when a test account can enroll each factor in the chosen order and sign in with it, and the configuration is exported as code or settings your team can review.

  4. Build conditional authentication flows

    Where the scope calls for it, DeployOpen builds conditional flows that decide when a second factor is required, for example by client, group, role or sign-in context. Each condition is written as a rule the security team can read and test. The team also defines fallback behavior for users who have no enrolled factor yet. The step closes when each flow has a test case showing the expected outcome for allowed and denied paths, and the flow diagrams are documented.

  5. Test with a pilot group of real users

    DeployOpen and your team run a pilot with a small group of your own users on devices and browsers they actually use. Testing covers enrollment, sign-in with each factor, lost device and recovery code use, help desk reset steps, and the applications that depend on the flow. Issues are logged with the fix and the retest result. The step closes when the pilot group completes the agreed test scripts and the open issues are either fixed or accepted in writing by the client.

  6. Roll out in stages without locking users out

    The rollout moves user groups in the order set in the scope, starting with opt-in enrollment where possible before factors become mandatory. Your help desk receives the runbook for resets and recovery code issuance, and sign-in failure and enrollment metrics are reviewed after each wave. The step closes when each wave has passed its check and a rollback path for the flow is confirmed, so that a failed wave can be reverted without removing enrolled factors.

  7. Document and hand over to your team

    DeployOpen delivers configuration records, flow diagrams, the test scripts and results, the help desk runbook, the rollout log, and a list of known limits to confirm with your environment. Your engineers take part in a walkthrough and run a supervised reset and a realm change themselves. The step closes when your team has signed the handover checklist. DeployOpen prepares documentation and evidence for compliance reviews, but it does not issue audit reports, attestations or certifications, which independent auditors and certification bodies provide.

  8. Continue support under an optional retainer

    If you want ongoing help, DeployOpen can provide retainer support covering Keycloak upgrades, changes to factors or flows, periodic review of sign-in failures, and retesting after release updates. The retainer scope, response expectations and fees are agreed in writing, not assumed from this page. Ask for the retainer terms in the quote so the recurring cost is visible next to the one-time build cost before you decide.

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.