Passkeys differ from traditional username-based methods for passwordless sign-in and MFA. This article will guide you on how to create the most effective passkey experience for your users, focusing on web browsers as the platform.
Username-initiated authentication
Traditional passwordless sign-in on web browsers typically begins with the user entering an identifier of some kind. For example, the user may be prompted to enter their email address in order to initiate a challenge via an email OTP code or magic link.
The email address here acts as a username which is necessary both to look up the account and to verify that it belongs to the user. We need to find the account associated with the email address and then send out an email that can be used to verify account ownership.
Device-initiated authentication
One important way that passkeys differ from traditional passwordless sign-in is that we don't need to start authentication by requiring the user to input a username such as an email address.
This is because passkeys are associated with devices - either they're only available on a single device ("device-bound") or they're synced between multiple devices via a backend (e.g. iCloud Keychain or Google Password Manager). This means we can display the passkeys available on the device without prompting the user to first enter their username. Once the user selects a passkey, we can use an internal identifier on the passkey credential to look up their account.
Most of the time a user will only have at most one passkey for a given website; but if a device is shared between family members, or if one user has multiple accounts for the same site, then multiple passkeys may be presented to select from.
Passkey autofill
Passkey autofill is an example of device-initiated authentication. It requires a username input field to work; but, crucially, the user only needs to focus this input field in order to see and select whatever passkeys are available. They don’t need to finishing typing out their username in order to see and select an available passkey.
Because it only shows passkeys if they’re available on the device, the autofill feature is an unobtrusive way to introduce passkeys to your sign-in page. If the user hasn’t set up a passkey yet and doesn’t know what they are, then they can still enter their username and proceed through a more familiar passwordless authentication challenge such as email OTP. But for users who do select an autofilled passkey, the site can look up their account based on the passkey selected. In addition, the site can authenticate the user at the same time by looking up the public key associated with the account and using it to verify the signature generated by the passkey’s private key.