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
When the Authorization header is sent with a prefix other than the configured one (default Bearer, though I override it to be JWT in my app), drf-jwt raises an AuthenticationFailed. This means that authentication is completely stopped and other auth plugins don't get a chance to run.
My app uses both drf-jwt and DRF Token authentication, so when I switched from the old djangorestframework-jwt to this, my DRF Token authentication stopped working. The old djangorestframework-jwt properly returned None instead of raising AuthenticationFailed when the prefix wasn't one it expected.
The text was updated successfully, but these errors were encountered:
To work around this I subclass JSONWebTokenAuthentication and override authenticate to do this:
defauthenticate(self, request):
ifrequest.environ.get('HTTP_AUTHORIZATION', '').startswith('JWT'): # Note I override prefix from Bearer to JWTreturnsuper().authenticate(request)
When the
Authorization
header is sent with a prefix other than the configured one (defaultBearer
, though I override it to beJWT
in my app), drf-jwt raises an AuthenticationFailed. This means that authentication is completely stopped and other auth plugins don't get a chance to run.My app uses both drf-jwt and DRF Token authentication, so when I switched from the old djangorestframework-jwt to this, my DRF Token authentication stopped working. The old djangorestframework-jwt properly returned None instead of raising AuthenticationFailed when the prefix wasn't one it expected.
The text was updated successfully, but these errors were encountered: