SignInManager: return SignInResult.Failed for expired passkey session challenge#67539
Open
GrantTotinov wants to merge 5 commits into
Open
SignInManager: return SignInResult.Failed for expired passkey session challenge#67539GrantTotinov wants to merge 5 commits into
GrantTotinov wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates ASP.NET Core Identity’s SignInManager passkey sign-in flow so an expired/missing passkey session challenge results in a controlled SignInResult.Failed outcome instead of an unhandled exception, and adds a unit test for the scenario.
Changes:
- Add an early check in
PasskeySignInCoreAsyncto returnSignInResult.Failedwhen passkey session state is missing/invalid. - Add a new unit test covering the “expired/missing session challenge” passkey sign-in scenario.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/Identity/Core/src/SignInManager.cs | Adds early failure handling for missing/invalid passkey session state during passkey sign-in. |
| src/Identity/test/Identity.Test/SignInManagerTest.cs | Adds a new test to validate passkey sign-in returns Failed when the passkey session challenge is expired/missing. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
3 tasks
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.
SignInManager: return SignInResult.Failed for expired passkey session challenge
Summary of the changes
Return SignInResult.Failed for expired or missing passkey session challenge.
Description
Passkey sign-in currently throws when the server-side session challenge is missing or expired, resulting in an unhandled exception instead of a controlled sign-in failure.
This change ensures that missing or invalid passkey session state results in SignInResult.Failed, aligning the behavior with other SignInManager authentication flows.
Changes
Testing
Fixes #67410