Add PreSignInCheck to PasskeySignInCoreAsync and add unit tests#65316
Merged
wtgodbe merged 1 commit intorelease/10.0from Feb 5, 2026
Merged
Add PreSignInCheck to PasskeySignInCoreAsync and add unit tests#65316wtgodbe merged 1 commit intorelease/10.0from
wtgodbe merged 1 commit intorelease/10.0from
Conversation
Contributor
There was a problem hiding this comment.
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 inPasskeySignInCoreAsyncto 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 |
halter73
approved these changes
Feb 5, 2026
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.
Fix PasskeySignInAsync to enforce email/phone confirmation and lockout checks
Ensure
PasskeySignInAsync()respects sign-in options and lockoutDescription
SignInManager.PasskeySignInAsync()did not runPreSignInCheck()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 missingPreSignInCheck()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?
Passkey authentication is a new feature in .NET 10.
Risk
Small, targeted logic change in the passkey sign-in flow. New automated tests are added and manual verification has been performed.
Verification