Skip to content

Harden RefreshSignInCoreAsync to revalidate cookie always - #68103

Open
cincuranet wants to merge 2 commits into
dotnet:mainfrom
cincuranet:harden-refresh
Open

Harden RefreshSignInCoreAsync to revalidate cookie always#68103
cincuranet wants to merge 2 commits into
dotnet:mainfrom
cincuranet:harden-refresh

Conversation

@cincuranet

Copy link
Copy Markdown
Contributor

Fixes #68084

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

This PR hardens SignInManager.RefreshSignInAsync by ensuring the current authentication cookie’s security stamp is revalidated (after confirming the caller is the currently-authenticated user) before re-issuing the sign-in cookie, addressing #68084.

Changes:

  • Added a security-stamp validation step in RefreshSignInCoreAsync prior to calling SignInWithClaimsAsync.
  • Added new unit tests covering both the “stale stamp prevents refresh” and “matching stamp allows refresh” cases.

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 Validates the presented security stamp before re-issuing the application cookie during refresh sign-in.
src/Identity/test/Identity.Test/SignInManagerTest.cs Adds tests verifying refresh sign-in is blocked for stale stamps and allowed for matching stamps.

@cincuranet
cincuranet marked this pull request as ready for review July 31, 2026 09:01
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.

Harden RefreshSignInCoreAsync to revalidate cookie always

3 participants