Repository navigation
Conversation
michalsn
left a comment
There was a problem hiding this comment.
I haven't reviewed the implementation in detail yet, but at first glance, making revocation checks mandatory for all newly issued JWTs seems to impose a single model on applications that may deliberately prefer short-lived access tokens with a separate refresh token mechanism. Although the initial commit describes the feature as "opt-in", there doesn't appear to be a configuration option to disable these checks.
I think revocation support would be a useful addition, but applications should be able to choose whether to enable it. I'd be interested to hear what others think.
|
Thanks for raising this, @michalsn. I originally made revocation configurable with public bool $revocationEnabled = true;, but removed it because I consider the ability to immediately revoke issued tokens a fundamental security feature of an authentication framework. Short-lived access tokens and revocation are not mutually exclusive. Existing JWTs without a jti also remain valid until they expire, ensuring backward compatibility. That said, I understand the importance of flexibility in an open-source project and am open to restoring the configuration option, with revocation enabled by default. I'd be interested to hear what others think. |
Summary
Applications need a way to end API access before an issued JWT expires. This change lets an application revoke the JWT presented at logout. The Shield JWT filter rejects that token on later requests while other tokens issued to the same user remain valid.
jtiat issuance when the caller omits it and addJWTManager::revokeToken()for a signed, unexpired token.Config\Auth::$tables.JWTManager::purgeExpiredRevocations().Compatibility
Apply the migration before serving JWT traffic with the new release. Existing JWTs without
jtiremain usable under the existing signature and time checks. Clients holding those tokens need a newly issued JWT to use the logout endpoint.Audit logging uses Shield's existing token identifier column. Databases that enforce its 255-character limit can reject log entries for longer JWTs when a token check fails.
Checklist: