We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0d56349 commit 56c721dCopy full SHA for 56c721d
rest_framework_sso/authentication.py
@@ -3,6 +3,7 @@
3
4
import jwt
5
from django.contrib.auth import get_user_model
6
+from django.utils.encoding import smart_text
7
from django.utils.translation import ugettext as _
8
from rest_framework import exceptions
9
from rest_framework.authentication import (
@@ -26,8 +27,9 @@ class JWTAuthentication(BaseAuthentication):
26
27
28
def authenticate(self, request):
29
auth = get_authorization_header(request).split()
30
+ authenticate_header = self.authenticate_header(request=request)
31
- if not auth or auth[0].lower() != api_settings.AUTHENTICATE_HEADER.lower().encode('utf-8'):
32
+ if not auth or smart_text(auth[0].lower()) != authenticate_header.lower():
33
return None
34
35
if len(auth) == 1:
0 commit comments