The Web Authentication Browser API (also known as WebAuthn) is a specification written by the W3C and FIDO. The WebAuthn API allows servers to register and authenticate users using public key cryptography instead of a password. WebAuthn is commonly used with
- a USB, NFC, or Bluetooth low energy device (e.g. YubiKey) to authenticate;
- using an Operating System "platform module" (e.g. TouchID, FaceID, Windows Hello Face, Android Biometric Authentication, ...);
Once the end-user triggers the WebAuthn process, the browser will show a WebAuthn prompt which looks different per browser:
Ory's WebAuthN implementation can be used for both multi-factor authentication and passwordless authentication. You need to configure whether WebAuthn is used for passwordless, or for multi-factor authentication.
WebAuthn needs to be configured and is disabled per default.
passwordless is set to either
false, avoid changing it. Doing so may lock some users out of their accounts.
- Ory CLI
- Full Config
ory patch identity-config <your-project-id> \
--add '/selfservice/methods/webauthn/enabled=true' \
--add '/selfservice/methods/webauthn/config/passwordless=false' \
--add '/selfservice/methods/webauthn/config/rp/display_name="My Display Name"'
# If set to true will use WebAuthn for passwordless flows intead of multi-factor authentication.
# This MUST be your top-level-domain
# This MUST be the exact URL of the page which will prompt for WebAuthn!
# Only the scheme (https / http), host (auth.example.org), and port (4455) are relevant. The
# path is irrelevant
# A display name which will be shown to the user on her/his device.
(Custom) Identity Schema
All Ory presets have the correct settings for WebAuthn enabled.
If you want to use a custom identity schema, you need to define what field of the identity schema is the primary identifier for WebAuthn. This is used for both multi-factor authentication as well as passwordless:
title: 'Your E-Mail',
webauthn method would generate a credentials block as follows:
- # The name shown in the UI for the eky
# When the keay was added
# If true, is a credential used for passwordless flows.
# WebAuth2-specific values.
# The user handle will be used in the exchange with the FIDO2 device
# to ensure that the user handles from the key and from Ory match.