Open source video conferencing app powered by LiveKit. Built with Django and React.
🐛(backend) use the configured token type in BaseJWTAuthentication
lebaudantoinecee210972657
diff --git a/src/backend/core/external_api/authentication.py b/src/backend/core/external_api/authentication.pyindex 445eb02f..07dfeb1c 100644--- a/src/backend/core/external_api/authentication.py+++ b/src/backend/core/external_api/authentication.py@@ -48,6 +48,7 @@ class BaseJWTAuthentication(authentication.BaseAuthentication):self.is_enabled = is_enabledself._token_service = None+ self._token_type = token_typeif not self.is_enabled:return@@ -73,7 +74,10 @@ class BaseJWTAuthentication(authentication.BaseAuthentication):auth_header = authentication.get_authorization_header(request).split()- if not auth_header or auth_header[0].lower() != b"bearer":+ if (+ not auth_header+ or auth_header[0].lower() != self._token_type.lower().encode()+ ):# Defer to next authentication backendreturn None@@ -159,7 +163,7 @@ class BaseJWTAuthentication(authentication.BaseAuthentication):def authenticate_header(self, request):"""Return authentication scheme for WWW-Authenticate header."""- return "Bearer"+ return self._token_typedef authenticate_credentials(self, token):"""Validate JWT token and return authenticated user.