Skip to content

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

Merged
rolandVi merged 5 commits into
dotnet:mainfrom
rolandVi:passkeys/harden-manage-passkeys-reauth
Aug 28, 2026
Merged

Require reauthentication before adding a passkey or setting a password#68522
rolandVi merged 5 commits into
dotnet:mainfrom
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
@rolandVi rolandVi added the area-identity Includes: Identity and providers label Aug 19, 2026
@cincuranet
cincuranet requested a balanced review from Copilot August 24, 2026 08:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds recent credential-based reauthentication before users can create permanent sign-in credentials.

Changes:

  • Adds password, passkey, and external-login reauthentication flows.
  • Protects passkey creation and password-setting endpoints.
  • Adds template and Identity security-stamp tests.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
ReauthenticationPrompt.razor Implements shared credential confirmation UI.
PasskeySubmit.razor.js Adds passkey reauthentication support.
PasskeyReauthentication.cs Stores and validates confirmation markers.
PasskeyOperation.cs Adds the reauthentication operation.
SetPassword.razor Requires confirmation before setting a password.
Passkeys.razor Requires confirmation before passkey enrollment.
ChangePassword.razor Clarifies session invalidation behavior.
IdentityComponentsEndpointRouteBuilderExtensions.cs Secures and adds reauthentication endpoints.
template-baselines.json Registers new generated template files.
BlazorTemplateTest.cs Tests password confirmation for passkey creation.
FunctionalTest.cs Tests security-stamp session behavior.
SignInManager.cs Documents passkey enrollment security guidance.

Comment thread src/Identity/Core/src/SignInManager.cs
@rolandVi
rolandVi changed the base branch from rolandVi/passkey-work to main August 26, 2026 09:19
@rolandVi
rolandVi requested a review from SamMonoRT as a code owner August 26, 2026 09:19
@rolandVi
rolandVi merged commit a9499eb into dotnet:main Aug 28, 2026
29 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-identity Includes: Identity and providers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Harden Components/Account/Pages/Manage/Passkeys.razor

3 participants