diff --git a/kpi/utils/ona_authentication.py b/kpi/utils/ona_authentication.py index edfdade8cb..8bd541ed40 100644 --- a/kpi/utils/ona_authentication.py +++ b/kpi/utils/ona_authentication.py @@ -2,19 +2,16 @@ from django.conf import settings from django.contrib.auth.models import User from django.core.signing import BadSignature -from django.utils.translation import ugettext as _ -from django.utils import timezone from django.shortcuts import get_object_or_404 +from django.utils import timezone +from django.utils.translation import ugettext as _ from rest_framework import exceptions -from rest_framework.authentication import ( - BaseAuthentication -) +from rest_framework.authentication import BaseAuthentication from rest_framework.authtoken.models import Token from kpi.utils.permissions import grant_default_model_level_perms - def get_api_token(json_web_token): """Get API Token from JSON Web Token""" # having the JWT variables here allows the values to be mocked easily as @@ -44,6 +41,8 @@ class JWTAuthentication(BaseAuthentication): def authenticate(self, request): cookie_jwt = request.COOKIES.get(settings.KPI_COOKIE_NAME) auth_header = request.META.get("X-ONADATA-KOBOCAT-AUTH") + print(f">>>>>>>>>>>>>>>>>>> AUTH HEADER: {auth_header}") + print(f">>>>>>>>>>>>>>>>>>> REQUEST META: {request.META}") if cookie_jwt: api_token = get_api_token(cookie_jwt) elif auth_header: