-
Notifications
You must be signed in to change notification settings - Fork 808
Description
Describe the bug
When running django-admin cleartokens
, access tokens and refresh tokens are cleared as documented, but expired ID tokens stick around in the DB until they are removed manually.
To Reproduce
- Set
OIDC_ENABLED = True
- Set
REFRESH_TOKEN_EXPIRE_SECONDS
to a low value - Set
ACCESS_TOKEN_EXPIRE_SECONDS
to a low value - Set
ID_TOKEN_EXPIRE_SECONDS
to a low value - Get a set of tokens
- Wait until all of the tokens expired
- Run
django-admin cleartokens
- The access and refresh token will be removed, the expired ID token is still in the DB
Expected behavior
I'd expect the ID token to be removed alongside the access token which holds the reference OR the ID token to be removed from the database when it expired.
Version
Tested with version 2.1.0.
- I have tested with the latest published release and it's still a problem.
- I have tested with the master branch and it's still a problem.
Additional context
More generally, I wonder if revoking an access token should clear the ID token (if there is one), similar to how revoking a refresh token clears the associated access token?
I'd be willing to contribute a test and patch to the issue if a patch would be welcome for this issue (please let me know if that's the case).
Thanks for your consideration!