Skip to content

feat(identity): "sign out everywhere" via security stamp regeneration#188

Merged
antosubash merged 2 commits into
mainfrom
feature/feat-identity-sign-security-stamp-regeneration-g4wfq
May 10, 2026
Merged

feat(identity): "sign out everywhere" via security stamp regeneration#188
antosubash merged 2 commits into
mainfrom
feature/feat-identity-sign-security-stamp-regeneration-g4wfq

Conversation

@antosubash
Copy link
Copy Markdown
Owner

Closes #179.

Summary

  • New SignOutEverywhereEndpoint (POST /Identity/Account/Manage/SignOutEverywhere) regenerates the user's ASP.NET Identity security stamp, signs out the current cookie, and publishes UserSignedOutEverywhereEvent over the Wolverine bus. OpenIddict subscribes and revokes any outstanding access/refresh tokens — going through the bus avoids a Users → OpenIddict reference (the module graph forbids it).
  • New Security section on Manage/Index.tsx with a destructive "Sign out everywhere" button + confirmation dialog. Login page surfaces a friendly toast when redirected with ?signedOutEverywhere=true.
  • Configurable UsersModuleOptions.SecurityStampValidationInterval (default 1 minute, down from Identity's 30 minutes) so other devices' cookies die faster after the action.
  • Drive-by fix: AuditConfigCacheInvalidator was internal static, but Wolverine's default discovery scans only public types. Made it public static so it actually runs on SettingChangedEvent. Same fix applied to the new UserSignedOutEverywhereHandler.
  • Added WebApplicationFactoryClientOptions overload to CreateAuthenticatedClient for tests that need to assert on a redirect itself.

Test plan

  • dotnet test modules/Users/tests/SimpleModule.Users.Tests — 43/43 passing (3 new for this feature)
  • dotnet test modules/OpenIddict/tests/SimpleModule.OpenIddict.Tests — 20/20 passing
  • dotnet test modules/AuditLogs/tests/SimpleModule.AuditLogs.Tests — 37/37 passing
  • dotnet test modules/Admin/tests/SimpleModule.Admin.Tests — 28/29 passing (1 unrelated pre-existing skip)
  • End-to-end verified with Playwright: login → Manage → click "Sign out everywhere" → confirm → land on /Identity/Account/Login?signedOutEverywhere=true with the toast rendered. Server-side log confirms UserSignedOutEverywhereEvent was dispatched and the OpenIddict handler revoked tokens.
  • Wolverine startup log no longer emits "Wolverine found no handlers" — both handler classes are discovered.

…tion

Adds a user-initiated "Sign out everywhere" action that regenerates the
ASP.NET Identity security stamp, signs out the current cookie, and
publishes UserSignedOutEverywhereEvent so OpenIddict revokes any
outstanding access/refresh tokens. Closes #179.

Also fixes a latent bug in AuditConfigCacheInvalidator: Wolverine's
default handler discovery only scans public types, so the existing
internal handler was never being invoked on SettingChangedEvent.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 10, 2026

Deploying simplemodule-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0c3d485
Status: ✅  Deploy successful!
Preview URL: https://a9af5d70.simplemodule-website.pages.dev
Branch Preview URL: https://feature-feat-identity-sign-s.simplemodule-website.pages.dev

View logs

…-sign-security-stamp-regeneration-g4wfq

# Conflicts:
#	packages/SimpleModule.Client/src/routes.ts
@antosubash antosubash merged commit bae1840 into main May 10, 2026
6 checks passed
@antosubash antosubash deleted the feature/feat-identity-sign-security-stamp-regeneration-g4wfq branch May 10, 2026 21:22
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.

Identity: "sign out everywhere" via security stamp regeneration

1 participant