fix(core): revoke active JWT tokens after logout#2571
Conversation
revoke active JWT tokens after logout GH-2570
SonarQube reviewer guideSummary: Add token revocation checking to bearer token verification by introducing a utility function that validates tokens against a revoked token repository across both symmetric and asymmetric token verifiers. Review Focus:
Start review at:
|
| value(): VerifyFunction.BearerFn { | ||
| return async (token: string) => { | ||
| // Check if token has been revoked | ||
| await checkIfTokenRevoked(token, this.revokedTokenRepo, this.logger); |
There was a problem hiding this comment.
where are we revoking this token actually ?
There was a problem hiding this comment.
sir the token is revoked using the existing RevokedTokenRepository
on logout (idp-login.service.ts) : token is stored via revokedTokensRepo.set()
on api request (services-bearer-asym-token-verifier.ts) : token is checked via checkIfTokenRevoked() which calls revokedTokenRepo.get(token) and throws TokenRevoked error if found
The same mechanism that the authentication service and facade services already use - we just added the same check to the service-level verifiers which were missing it.



GH-2570
JWT Logout Security Fix
Problem Statement
Security Vulnerability: JWT Tokens Remain Valid After Logout
Issue: When a user logs out of the system, their JWT access token remains valid until its natural expiration time, allowing the token to be used for authenticated requests even after logout.
Impact: This creates a security vulnerability where:
Type of change
Checklist:
Build:
Test: