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
@@ -77,7 +78,7 @@ When set to ``True``, causes refresh tokens submitted to the
77
78
``TokenRefreshView`` to be added to the blacklist if the blacklist app is in
78
79
use and the ``ROTATE_REFRESH_TOKENS`` setting is set to ``True``.
79
80
You need to add ``'rest_framework_simplejwt.token_blacklist',`` to your
80
-
``INSTALLED_APPS`` in the settings file to use this settings.
81
+
``INSTALLED_APPS`` in the settings file to use this setting.
81
82
82
83
Learn more about :doc:`/blacklist_app`.
83
84
@@ -159,7 +160,12 @@ collection will be used to build the "WWW-Authenticate" header in the response.
159
160
``AUTH_HEADER_NAME``
160
161
----------------------------
161
162
162
-
The authorization header name to be used for authentication. The default is ``HTTP_AUTHORIZATION`` which will accept the ``Authorization`` header in the request. For example if you'd like to use ``X_Access_Token`` in the header of your requests please specify the ``AUTH_HEADER_NAME`` to be ``HTTP_X_ACCESS_TOKEN`` in your settings.
163
+
The authorization header name to be used for authentication.
164
+
The default is ``HTTP_AUTHORIZATION`` which will accept the
165
+
``Authorization`` header in the request. For example if you'd
166
+
like to use ``X_Access_Token`` in the header of your requests
167
+
please specify the ``AUTH_HEADER_NAME`` to be
168
+
``HTTP_X_ACCESS_TOKEN`` in your settings.
163
169
164
170
``USER_ID_FIELD``
165
171
-----------------
@@ -180,6 +186,15 @@ The claim in generated tokens which will be used to store user identifiers.
180
186
For example, a setting value of ``'user_id'`` would mean generated tokens
181
187
include a "user_id" claim that contains the user's identifier.
182
188
189
+
``USER_AUTHENTICATION_RULE``
190
+
----------------------------
191
+
192
+
Callable to determine if the user is permitted to authenticate. This rule
193
+
is applied after a valid token is processed. The user object is passed
194
+
to the callable as an argument. The default rule is to check that the ``is_active``
195
+
flag is still ``True``. The callable must return a boolean, ``True`` if authorized,
196
+
``False`` otherwise resulting in a 401 status code.
0 commit comments