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
|expired_token_loader | Function to call when an expired token accesses a protected view | None |
330
+
|invalid_token_loader | Function to call when an invalid token accesses a protected view | Takes one argument, which is an error string of why it is invalid|
331
+
|unauthorized_loader | Functino to call when a request with no JWT accesses a protected view | None|
332
+
|needs_fresh_token_loader | Function to call when a non-fresh token access a **fresh_jwt_required** view | None |
333
+
|revoked_token_loader | Function to call when a revoked token accesses a protected view | None |
331
334
332
335
### Options
333
336
You can change many options for how this extension works via
334
337
```python
335
338
app.config[OPTION_NAME] = new_options
336
339
```
337
340
The available options are:
338
-
* JWT_ACCESS_TOKEN_EXPIRES: datetime.timedelta of how long an access token should
339
-
live before it expires (Defaults to 15 minutes)
340
-
* JWT_REFRESH_TOKEN_EXPIRES: datetime.timedelta of how long a refresh token should
341
-
live before it expires (Defaults to 30 days)
342
-
* JWT_ALGORITHM: Which algorithm to use with the JWT. See [here] (https://pyjwt.readthedocs.io/en/latest/algorithms.html)
343
-
for options (Defaults to HS256)
344
-
* JWT_BLACKLIST_ENABLED: If token blacklist/revoking should be enabled (Default False)
345
-
* JWT_BLACKLIST_STORE: Where to save blacklisted tokens. See [here] (http://pythonhosted.org/simplekv/)
346
-
for options (Default None)
347
-
* JWT_BLACKLIST_CHECKS: What tokens to check against the blacklist. Options are 'refresh' which
348
-
will only check refresh tokens, and 'all' which will check refresh and access tokens. Defaults
349
-
to 'refresh'
341
+
342
+
| Name | Description | Options | Default|
343
+
| ------ | ----------- | ------- | ------ |
344
+
|JWT_ACCESS_TOKEN_EXPIRES | How long an access token should live | datetime.timedelta | 15 minutes|
345
+
|JWT_REFRESH_TOKEN_EXPIRES | How long a refresh token should live | datetime.timedelta | 30 days |
346
+
|JWT_ALGORITHM | Which algorithm to use with the JWT. [See here] (https://pyjwt.readthedocs.io/en/latest/algorithms.html)| HS256 |
347
+
|JWT_BLACKLIST_ENABLED | If token blacklist/revoking should be enabled | Boolean | False |
348
+
|JWT_BLACKLIST_STORE | Where to save blacklisted tokens. [See here] (http://pythonhosted.org/simplekv/)| None |
349
+
|JWT_BLACKLIST_CHECKS | What token types to check against the blacklist. | 'refresh', 'all' | 'refresh' |
350
350
351
351
### Blacklist and Token Revoking
352
352
This supports optional blacklisting and token revoking out of the box. This will allow you
0 commit comments