Skip to content

Conversation

@mandarini
Copy link

Description

Adds support for allow_expired=true query parameter to allow decoding expired JWTs for legitimate use cases (debugging, audit logs, displaying user info after expiration).

Fixes: #2256

Changes

  • Modified parseJWTClaims() in internal/api/auth.go to check for allow_expired query parameter
  • When allow_expired=true, JWT parser skips claims validation (including expiration check)
  • Default behavior unchanged: JWTs are validated including expiration by default

Security Considerations

  • The JWT signature is still verified (not bypassed)
  • Only the expiration time check is skipped
  • This should be used only for specific legitimate use cases
  • The client library (supabase-js) will control when this parameter is passed

Testing

Tested with expired JWTs:

  • Without parameter: correctly rejects with expiration error
  • With allow_expired=true: successfully decodes and returns user data
  • Signature validation still enforced in both cases

@mandarini mandarini force-pushed the feat/support-allow-expired-jwt-parameter branch from 77ba7de to 3b35ecc Compare November 13, 2025 08:29
@mandarini mandarini self-assigned this Nov 13, 2025
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.

getClaims allowExpired

2 participants