This repository was archived by the owner on May 26, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,8 @@ JWT_AUTH = {
127
127
' JWT_VERIFY_EXPIRATION' : True ,
128
128
' JWT_LEEWAY' : 0 ,
129
129
' JWT_EXPIRATION_DELTA' : datetime.timedelta(seconds = 300 ),
130
+ ' JWT_AUDIENCE' : None ,
131
+ ' JWT_ISSUER' : None ,
130
132
131
133
' JWT_ALLOW_REFRESH' : False ,
132
134
' JWT_REFRESH_EXPIRATION_DELTA' : datetime.timedelta(days = 7 ),
@@ -182,6 +184,16 @@ This is an instance of Python's `datetime.timedelta`. This will be added to `dat
182
184
183
185
Default is ` datetime.timedelta(seconds=300) ` (5 minutes).
184
186
187
+ ### JWT_AUDIENCE
188
+ This is a string that will be checked against the ` aud ` field of the token, if present.
189
+
190
+ Default is ` None ` (fail if ` aud ` present on JWT).
191
+
192
+ ### JWT_ISSUER
193
+ This is a string that will be checked against the ` iss ` field of the token.
194
+
195
+ Default is ` None ` (do not check ` iss ` on JWT).
196
+
185
197
### JWT_ALLOW_REFRESH
186
198
Enable token refresh functionality. Token issued from ` rest_framework_jwt.views.obtain_jwt_token ` will have an ` orig_iat ` field. Default is ` False `
187
199
Original file line number Diff line number Diff line change 28
28
'JWT_VERIFY_EXPIRATION' : True ,
29
29
'JWT_LEEWAY' : 0 ,
30
30
'JWT_EXPIRATION_DELTA' : datetime .timedelta (seconds = 300 ),
31
+ 'JWT_AUDIENCE' : None ,
32
+ 'JWT_ISSUER' : None ,
31
33
32
34
'JWT_ALLOW_REFRESH' : False ,
33
35
'JWT_REFRESH_EXPIRATION_DELTA' : datetime .timedelta (days = 7 ),
34
36
35
37
'JWT_AUTH_HEADER_PREFIX' : 'JWT' ,
36
-
37
- 'JWT_AUDIENCE' : None ,
38
38
}
39
39
40
40
# List of settings that may be in string import notation.
Original file line number Diff line number Diff line change @@ -53,7 +53,8 @@ def jwt_decode_handler(token):
53
53
api_settings .JWT_VERIFY ,
54
54
verify_expiration = api_settings .JWT_VERIFY_EXPIRATION ,
55
55
leeway = api_settings .JWT_LEEWAY ,
56
- audience = api_settings .JWT_AUDIENCE
56
+ audience = api_settings .JWT_AUDIENCE ,
57
+ issuer = api_settings .JWT_ISSUER
57
58
)
58
59
59
60
You can’t perform that action at this time.
0 commit comments