Skip to content

Require reauthentication before adding a passkey or setting a password - #68522

Open
rolandVi wants to merge 2 commits into
dotnet:rolandVi/passkey-workfrom
rolandVi:passkeys/harden-manage-passkeys-reauth
Open

Require reauthentication before adding a passkey or setting a password#68522
rolandVi wants to merge 2 commits into
dotnet:rolandVi/passkey-workfrom
rolandVi:passkeys/harden-manage-passkeys-reauth

Conversation

@rolandVi

Copy link
Copy Markdown
Member

In the Blazor template with Individual Accounts, adding a passkey now asks you to confirm who you
are first, with a credential the account already has.

What changed

The confirmation is a shared ReauthenticationPrompt component that offers whatever the account
actually holds: its password, one of its existing passkeys, or a re-challenge of a linked external
login. Confirming writes a data-protected cookie holding the user id and the current security stamp,
so changing the password or signing out everywhere invalidates it.

/Account/PasskeyCreationOptions moves into the /Manage group, which requires authorization, and
now refuses to hand out options without that marker. Left where it was, a cookie holder could fetch
options straight from it and skip the page entirely.

Confirming with a passkey goes through a new options endpoint that takes no username, and the
handler checks the asserted passkey belongs to the account that is already signed in.

SetPassword takes the same confirmation. It only gates on whether the account has a password yet,
so otherwise a cookie holder could set one and immediately use it to pass the new gate.

Resolves #66865.

@rolandVi
rolandVi requested review from cincuranet and rokonec August 14, 2026 11:58
@rolandVi
rolandVi requested a review from a team as a code owner August 14, 2026 11:58
@rolandVi
rolandVi removed the request for review from a team August 14, 2026 11:58
@rolandVi
rolandVi requested a review from a team August 14, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant