Skip to content
Kirby 6 is here! Learn more

Passkeys & two-factor authentication

Protect logins with passkeys and a second factor. Every user can set them up for their own account.

Passkeys

Passkeys (WebAuthn) replace something you remember with something you have: the passkey lives on the user's device, in their password manager or on a hardware security key and is unlocked with the device's biometrics or PIN.

Users can use passkeys in two ways:

  • As login method: With the webauthn login method enabled, users don't type an email address. The browser opens its passkey prompt right away, the user picks one of their passkeys for your site and unlocks it, and Kirby identifies the account from the passkey itself.
  • As second factor: Users log in with email and password and then confirm with one of their passkeys. This works without any configuration.

Passkeys need HTTPS, except on localhost, and are bound to the host of your site URL: passkeys registered on a staging domain don't work on your production domain.

Managing passkeys

Users manage their passkeys in the security drawer of their account: Security › Passkeys. They can give each new passkey a name, e.g. "Work laptop" or "YubiKey". Users have to be logged in to register their first passkey, and nobody can register a passkey for someone else.

To remove one of their passkeys, users confirm with one of their passkeys. Admins can remove the passkeys of other users after confirming with their own password, e.g. when a device got lost.

Two-factor authentication

Kirby comes with three second factors:

  • Passkeys: see above
  • Authenticator app: time-based one-time codes (TOTP) from an app. Each code is valid once and renews every 30 seconds.
  • Code via email: Kirby sends a one-time code to the account's email address.

Every user can set up a second factor for their own account in the security drawer. From then on, Kirby asks this user for the second factor after their password.

To require a second factor from every user, set the 2fa option. Users who haven't set up a passkey or authenticator app then get a code via email.

You can add other types of second factors, e.g. SMS, with auth challenge plugins.

Setting up an authenticator app

  1. Open the security drawer of your account and choose Authenticator app.
  2. Scan the QR code with your app, or add the setup key manually.
  3. Confirm with a code generated by your app.

Popular authenticator apps include:

The security drawer

Open your account in the Panel (or, as an admin, any user), click the settings button and choose Security. The security drawer bundles everything about how this account logs in:

  • Sign in methods lists the account's email address and the enabled login methods: password, login via code and passkeys.
  • Two-factor methods lists the enabled second factors: passkeys, authenticator app and code via email.

Which methods show up depends on the auth options. Plugins with their own login methods or second factors can add entries as well.

QR Code® is a registered trademark of DENSO WAVE INCORPORATED.