Repository navigation
feat(auth): sign in with just a passkey, no email or password - #18
Merged
Merged
Conversation
Add a discoverable-credential WebAuthn ceremony at
/webauthn/auth/passkey/{start,finish}. Start sends an empty
allowCredentials so the browser offers any passkey for the RP; finish
resolves the account from the chosen credential, requires the userHandle
to match it, then applies the same moderation, email-verification and
forced-password-change gates as password login via the now-shared
issueSessionOrForceChange.
The login page gets a "Sign in with a passkey" button, and the Settings
copy now says passkeys can replace the password. No migration: the
user-less challenge uses a sentinel user_id under its own ceremony type.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Passkeys only worked as a second step after typing an email and password. Now you can sign in with a passkey alone: hit Sign in with a passkey on the login page, pick one, and you're in.
The new
/webauthn/auth/passkey/{start,finish}ceremony sends an emptyallowCredentials, so the browser offers any passkey it holds for the site. The server resolves the account from the chosen credential, requires theuserHandleto match it, then runs the same moderation, email-verification and forced-password-change gates as password login (via the now-sharedissueSessionOrForceChange). Those gates run only after the assertion verifies, so a bare credential id can't be used to probe an account's state.user_idunder its ownpasskeyceremony type, so it can't be swapped with a user-bound challenge.RATE_LIMITER_AUTHas the existing ceremony; the API worker already proxies the/webauthn/authprefix.Tests: new unit tests for the discoverable assertion check (wrong/missing
userHandlerefused, challenge scoped to the passkey type) and the finish route; auth (412) and frontend (917) suites pass. Added an e2e case to2fa.spec.tsusing the virtual authenticator; not run locally yet.