You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 26, 2020. It is now read-only.
I'd like to add the support for jti claim to the package. The idea basically would be to store a list of expired jti's somewhere on the server side, and allow to blacklist specific tokens.
The way I'm thinking about the implementation is:
Use pymongo to store the blacklist (rather than a django specific mongo package, makes our solution portable to vanilla python or other frameworks)
Generate a long enough jti claim that will have negligible probability of being produced twice before the first one expired (string of 20 random ascii_letters and digits maybe?)
Store the jti and the entire payload in mongodb, this will help us clean up the collection when a JWT is past the expiry date (so we don't grow the collection ad infinitum)
Add a flag in api_settings.JWT_ENABLE_BLACKLIST, if True we add the jti claim to the payload in jwt_payload_handler()
Check against the mongodb collection everytime we decode a JWT (if JWT_ENABLE_BLACKLIST is True) and if the jti is blacklisted treat it as if the JWT is expired