Blocklist a legacy JWT locally once GET legacy-auth/logout ends its session - #507
Open
gamadev1 wants to merge 2 commits into
Open
Blocklist a legacy JWT locally once GET legacy-auth/logout ends its session#507gamadev1 wants to merge 2 commits into
gamadev1 wants to merge 2 commits into
Conversation
GET legacy-auth/logout proxies gama-api's own GET /users/logout, relaying the caller's raw legacy JWT from the Authorization header. Pure passthrough like register/recovery - this backend never stored the token, so gama-api is the one actually invalidating the session, closing the gap where tokens/revoke couldn't touch a legacy-bridge session. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ession ValidateLegacyJwtAsync only checked signature/issuer/audience/expiry, so a token that gama-api had already logged out kept authenticating against this backend until its own exp naturally lapsed. LegacyLogoutAsync now records the token (SHA-256-hashed) in ICacheProvider/Redis on a successful proxy logout, TTL'd to its remaining lifetime; VerifyLegacyTokenAsync and GenerateTokenByCoreTokenAsync (tokens/old) both check it after signature validation. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.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.
Summary
feature/legacy-auth-logout), not yet merged tostaging— until Add legacy-auth-bridge logout endpoint #505 merges, this diff includes Add legacy-auth-bridge logout endpoint #505's changes too; it'll shrink to just the new commit once Add legacy-auth-bridge logout endpoint #505 lands.GET legacy-auth/logout(Add legacy-auth-bridge logout endpoint #505) proxies gama-api's own logout, butValidateLegacyJwtAsynconly checks signature/issuer/audience/expiry offline — it had no way to know a token was just logged out, so the same JWT kept authenticating against this backend until its ownexpnaturally lapsed.IdentityService.LegacyLogoutAsyncnow writes the token (SHA-256-hashed, not raw) toICacheProvider/Redis on a successful proxy logout, TTL'd to the token's own remaining lifetime.VerifyLegacyTokenAsync(per-request auth) andGenerateTokenByCoreTokenAsync(tokens/old) both check the blocklist right after signature validation.SyncLegacyAuthAsync(login/google) intentionally doesn't — a fresh login token can't already be blocklisted.docs/api/authentication.md,docs/api/endpoints.md,docs/business/identity-and-access.md,PROJECT_SNAPSHOT.md.Test plan
dotnet buildon the full solution (done locally, 0 warnings/0 errors)legacy-auth/login, call an authenticated endpoint, calllegacy-auth/logout, then retry the same authenticated endpoint with the same token and confirm it's now rejectedtokens/oldalso rejects a blocklisted token🤖 Generated with Claude Code