Skip to content

feat(jwt): revoke browser session tokens on logout - #4

Open
maniaba wants to merge 2 commits into
feat/jwt-revocationfrom
feat/jwt-session-revocation
Open

maniaba wants to merge 2 commits into
feat/jwt-revocationfrom
feat/jwt-session-revocation

Conversation

@maniaba

@maniaba maniaba commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

Add JWTs tied to a completed Shield browser login. An application can issue a token from its authenticated session and revoke the current session’s JWTs before ending that web session. Other browser sessions and independently issued JWTs keep their own lifecycles.

  • Add JWTManager::generateSessionToken() and JWTManager::revokeCurrentSessionTokens().
  • Store one revocation entry for the browser session scope using the existing revocation table and cleanup API. Validate individual and session revocations in a single lookup.
  • Keep the revocation deadline fixed for a scope so an issuance request racing with logout cannot create a JWT that outlives the revocation record.
  • Document CSRF-protected application routes for issuing or renewing a JWT and logging out. An active browser session authorizes renewal.
  • Preserve full JWT identifiers in failed login records up to the existing 255-byte limit. Record an audit marker for longer values so rejecting the token can still return 401.

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.

1 participant