Skip to content

Add PreSignInCheck to PasskeySignInCoreAsync and add unit tests#65316

Merged
wtgodbe merged 1 commit intorelease/10.0from
mbuck/backport-65024-to-10.0
Feb 5, 2026
Merged

Add PreSignInCheck to PasskeySignInCoreAsync and add unit tests#65316
wtgodbe merged 1 commit intorelease/10.0from
mbuck/backport-65024-to-10.0

Conversation

@MackinnonBuck
Copy link
Copy Markdown
Member

@MackinnonBuck MackinnonBuck commented Feb 3, 2026

Fix PasskeySignInAsync to enforce email/phone confirmation and lockout checks

Ensure PasskeySignInAsync() respects sign-in options and lockout

Description

SignInManager.PasskeySignInAsync() did not run PreSignInCheck() prior to completing sign-in. As a result, passkey sign-in could succeed in cases where configured sign-in requirements would otherwise prevent sign-in (e.g., requiring confirmed email/phone, or when the user is locked out). This change adds the missing PreSignInCheck() call to the passkey sign-in path to match the behavior of other sign-in methods, and adds unit tests covering confirmed email, confirmed phone number, and lockout scenarios.

Fixes #65020

Customer Impact

This bug primarily affects apps that implement passwordless/passkey-first sign-in flows (not implemented in the Blazor Web App template), where passkeys can be registered pre-authentication. While we expect current customer impact to be limited, fixing this ensures passkey sign-in consistently honors configured sign-in requirements and lockout behavior.

Regression?

  • Yes
  • No

Passkey authentication is a new feature in .NET 10.

Risk

  • High
  • Medium
  • Low

Small, targeted logic change in the passkey sign-in flow. New automated tests are added and manual verification has been performed.

Verification

  • Manual (required)
  • Automated

Copilot AI review requested due to automatic review settings February 3, 2026 23:55
@MackinnonBuck MackinnonBuck added the Servicing-consider Shiproom approval is required for the issue label Feb 3, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a security issue where PasskeySignInAsync() was not enforcing sign-in requirements (confirmed email, confirmed phone number) and lockout checks. The fix adds a call to PreSignInCheck() in the passkey sign-in flow to match the behavior of other sign-in methods like password sign-in.

Changes:

  • Added PreSignInCheck() call in PasskeySignInCoreAsync to enforce sign-in requirements and lockout checks
  • Added three comprehensive unit tests covering confirmed email, confirmed phone number, and lockout scenarios for passkey sign-in

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Identity/Core/src/SignInManager.cs Added PreSignInCheck call in PasskeySignInCoreAsync method to enforce email/phone confirmation and lockout checks before completing passkey sign-in
src/Identity/test/Identity.Test/SignInManagerTest.cs Added three new unit tests (CanRequireConfirmedEmailForPasskeySignIn, CanRequireConfirmedPhoneNumberForPasskeySignIn, PasskeySignInReturnsLockedOutWhenLockedOut) to verify the fix works correctly

@MackinnonBuck MackinnonBuck added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels Feb 4, 2026
@rbhanda rbhanda added this to the 10.0.4 milestone Feb 5, 2026
@wtgodbe wtgodbe merged commit 6f58315 into release/10.0 Feb 5, 2026
33 of 34 checks passed
@wtgodbe wtgodbe deleted the mbuck/backport-65024-to-10.0 branch February 5, 2026 21:01
@dotnet-policy-service dotnet-policy-service bot modified the milestone: 10.0.4 Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Servicing-approved Shiproom has approved the issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants