Skip to content

Commit 3920395

Browse files
committed
Add cautionary notes about using blacklisted tokens with the default setting for JWT_TOKEN_ID.
It would be a breaking change, but I think we should consider making 'require' the default value at some point in the future, and perhaps drop support for 'off'.
1 parent 29f66c1 commit 3920395

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/index.md

+6
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ There are two options for blacklisting tokens:
189189

190190
When called, deletes all blacklisted tokens that have expired.
191191

192+
### Warning
193+
194+
Unless `JWT_TOKEN_ID` is set to `require`, blacklisting tokens will store the entire token value. This creates a potential problem if someone is able to read and delete records from the blacklist, either directly in the database or via the administrative interface. Note that the default value is `include`, not `require`. See the section on `JWT_TOKEN_ID` for how to migrate to requiring token id claims in all tokens.
195+
192196
## Additional Settings
193197
There are some additional settings that you can override similar to how you'd do it with Django REST framework itself. Here are all the available defaults.
194198

@@ -357,6 +361,8 @@ For new installations, please override the default and set this to `require`, as
357361

358362
For existing installations, when migrating from an older version (pre-1.17) or when changing the setting from `off`, we recommend setting this to `require` once all of the valid tokens have the id claims. This will typically be after `JWT_EXPIRATION_DELTA` has elapsed since upgrading or allowing id claims to be included.
359363

364+
Note that when set to `off` or `include`, the blacklist functionality - if used - will store the entire token value, which would allow someone with access to the administrative interface, or directly to the database, to steal an otherwise valid token and remove it from the blacklist. Using `require` for this setting means that only token identifiers are recorded for the blacklist and not entire tokens.
365+
360366
Default is `include`.
361367

362368
### JWT_AUDIENCE

0 commit comments

Comments
 (0)