Skip to content
Authentication

Keycloak passkeys and MFA, without a plugin

Passkeys in the normal login form, one-time codes from an authenticator app, security keys and recovery codes are all part of Keycloak 26. Here is what each one does, how to turn it on in a realm, and what is not built in.

Point here to play
A simplified drawing of Keycloak’s default browser flow with passkeys enabled.
The short answer

Keycloak 26 supports passkeys in its default login forms since 26.4: turn on Enable Passkeys in the realm’s WebAuthn Passwordless Policy, and the login page offers them through browser autofill and a Sign in with Passkey button. For two-factor sign-in, the default browser flow already asks for a one-time code from an authenticator app when a user has one, and security keys and recovery codes are one switch away in the same flow. Step-up sign-in for sensitive actions is built in too. SMS codes are not: they need an extension, which our tenant images do not support yet.

How it works

Built from Keycloak’s own parts

Realms, clients, authentication flows and mappers, as the standard admin console has them. Nothing here needs a custom extension.

Passkeys in the login form

Passkeys are WebAuthn credentials that sign people in without a password: synced ones in a password manager, and device-bound ones such as a security key. Keycloak added them to its default login forms in 26.3 as a preview and made them a supported feature in 26.4.

  1. In your realm, open Authentication, then Policies, then Webauthn Passwordless Policy.
  2. Turn Enable Passkeys on and save.

The username field then offers saved passkeys through the browser’s autofill (conditional UI), and a Sign in with Passkey button opens the browser’s own dialog (modal UI) for passkeys on other devices or security keys. The Passkey Mediation setting decides whether the dialog opens on its own when the page loads. People register a passkey from the account console, or your app asks them to with the WebAuthn Register Passwordless action.

With passkeys on, the default browser flow skips the second factor when someone signed in with a passkey, since a passkey already proves both. To ask for a second factor anyway, disable the Condition - credential step in that flow.

One-time codes from an authenticator app

Time-based one-time codes (TOTP) work with FreeOTP, Google Authenticator and other authenticator apps. Counter-based codes (HOTP) are available too. The realm’s OTP Policy sets the algorithm, the number of digits and the period.

The default browser flow has a Browser - Conditional 2FA sub-flow that asks for a code only when the user has set one up. To require codes from everyone, make Configure OTP a default required action, so each person sets up an app at their next sign-in. The authenticator URI tool and the TOTP generator help you test.

Security keys and recovery codes

Inside the same conditional sub-flow sit two more methods, disabled by default:

  • WebAuthn Authenticator, for a security key or a platform authenticator as the second factor. Set it to Alternative to offer it next to codes.
  • Recovery Authentication Code Form, supported since Keycloak 26.3. People print a set of single-use codes, and a code stands in for the phone they lost. Since 26.4 you can ask people to set up recovery codes right after they set up an authenticator app.

When a user has several methods, the login shows the one with the highest priority and a Try Another Way link for the rest. Brute-force detection protects passwords, one-time codes and recovery codes.

Stronger sign-in only where it matters

Step-up authentication asks for a second factor only for sensitive actions. In the realm, map ACR values to numeric levels of authentication, and build the browser flow with Conditional - Level Of Authentication steps: level 1 for a password, level 2 for a password and a code. Your app requests a level with acr_values or the claims parameter, and the token’s acr claim says what was done.

This is how an app lets people browse after a plain sign-in and asks for a code before changing an email or a payment method.

What is not built in

  • Codes by SMS: Keycloak has no built-in SMS sign-in. It needs an extension, and tenant images do not support extensions yet.
  • Push approvals in a vendor’s mobile app: these come from products with their own apps, not from Keycloak.
  • A custom look for the passkey and code pages: they use Keycloak’s built-in theme, since custom themes are not supported in tenant images yet.
Who does what

We run the server. You shape the realm.

RealmDeploy runs
  • Keycloak 26 with passkeys, recovery codes and step-up as supported features
  • Upgrades that bring new authentication features as Keycloak releases them
  • Your login on your own domain, which WebAuthn ties passkeys to
  • Backups of every registered credential with point-in-time restore
  • Monitoring and on-call
You configure, in the admin console
  • Enable Passkeys and the WebAuthn Passwordless Policy
  • The OTP Policy and whether codes are required
  • Security keys and recovery codes in the browser flow
  • Levels of authentication for step-up
  • Required actions that ask people to set up a method
Which plan

Any plan

The plans are sized by realms and by active users a month: people who sign in at least once in the month. These are sizing guides, not hard caps.

Starter$199 a month
  • Dedicated Keycloak, 1 replica
  • Up to 2 realms
  • Sized for about 5,000 active users a month
  • Best effort, no uptime SLA
Premium$999 a month
  • High-availability cluster, 2+ replicas
  • Up to 20 realms
  • Sized for about 100,000 active users a month
  • 99.9% monthly uptime SLA
Enterprise$2,499 a month
  • Larger high-availability cluster
  • Up to 100 realms
  • Sized for about 500,000 active users a month
  • 99.95% monthly uptime SLA

Every plan has every one of these features, because they are part of Keycloak itself. Pick the plan by size and uptime: Starter for about 5,000 active users with no SLA, Premium for about 100,000 with two or more replicas and a 99.9% SLA, Enterprise for about 500,000 with a 99.95% SLA.

Every plan, feature by feature

Questions

Frequently asked questions

Are passkeys supported or still a preview?

Supported. Passkeys were added to the default login forms as a preview in Keycloak 26.3 and became a supported feature in 26.4. Our clusters run a newer Keycloak 26 release.

Do passkeys replace passwords completely?

They can. People who registered a passkey sign in with it from the username field, without a password. Others keep signing in with a password and a second factor until they add one.

Why do passkeys depend on our domain?

WebAuthn ties every passkey to the domain it was registered on. Keep your login on one stable domain, such as auth.yourcompany.com, and passkeys keep working through upgrades and restores.

Can I require two-factor sign-in for everyone?

Yes. Make Configure OTP, or a WebAuthn registration, a default required action, so everyone sets one up at their next sign-in, and keep the conditional two-factor step in the browser flow.

What happens when someone loses their phone?

With recovery codes enabled, they sign in with one of their printed codes and set up a new app. Without them, an admin removes the old credential in the admin console so they can set up a new one.

Can I send codes by SMS or email?

Not with a built-in step. SMS needs an extension, and tenant images do not support extensions yet. Authenticator apps, passkeys, security keys and recovery codes are built in.

Does a passkey sign-in still ask for a second factor?

Not by default: the browser flow skips it when a passkey was used. Disable the Condition - credential step if you want a second factor after every sign-in.

Run it on a cluster of your own

Order a realm in the dashboard, or write to us first about what you are building.