djangorestframework-simplejwt icon indicating copy to clipboard operation
djangorestframework-simplejwt copied to clipboard

added Outstanding tokens to Blacklisted tokens but token still working

Open Goathemis opened this issue 1 year ago • 3 comments

hello i added 'rest_framework_simplejwt.token_blacklist', to INSTALLEDS_APPS then run python manage.py migrate. The outstanding tokens and blacklisted tokens display on django admin. i try to authenticated . the authenticated token added in outstanding tokens after that i added token to blacklisted tokens token still work.

Goathemis avatar Aug 20 '23 00:08 Goathemis

if used jwt then "refresh-token" is placed on the blacklist (blacklisted/logged out). If the refresh token is used, it is rejected, but the access token still works until its expiration time, as the access token is never checked against the blacklist (which is probably purpose because only refresh tokens are in blacklist checking, access tokens goes through without blacklist inspection).

triplaj avatar Feb 25 '24 18:02 triplaj

Not sure whether this is a bug or intended behavior. I can confirm that blacklisting works on the refresh token and not on the access token of a token pair. That means the access token remains usable until it expires. It would be nice to have a method that invalidates the access token.

jdejoode avatar Mar 19 '24 10:03 jdejoode

Relevant: https://github.com/jazzband/djangorestframework-simplejwt/issues/713#issuecomment-1614293564 @tpotjj argues that the access token should be short-lived and hence might not require invalidating

jdejoode avatar Mar 19 '24 10:03 jdejoode