From e442d2cf3e2495c4ae871649d19bf4f4f8589741 Mon Sep 17 00:00:00 2001 From: Douglas Hall Date: Mon, 4 Mar 2019 17:42:29 -0500 Subject: [PATCH] Add JwtAuthentication to user profile image API. --- openedx/core/djangoapps/profile_images/views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openedx/core/djangoapps/profile_images/views.py b/openedx/core/djangoapps/profile_images/views.py index 5b1b99f782..2d5512e168 100644 --- a/openedx/core/djangoapps/profile_images/views.py +++ b/openedx/core/djangoapps/profile_images/views.py @@ -8,6 +8,7 @@ from contextlib import closing from pytz import UTC from django.utils.translation import ugettext as _ +from edx_rest_framework_extensions.auth.jwt.authentication import JwtAuthentication from edx_rest_framework_extensions.auth.session.authentication import SessionAuthenticationAllowInactiveUser from rest_framework import permissions, status from rest_framework.parsers import FormParser, MultiPartParser @@ -110,7 +111,11 @@ class ProfileImageView(DeveloperErrorViewMixin, APIView): """ parser_classes = (MultiPartParser, FormParser, TypedFileUploadParser) - authentication_classes = (OAuth2AuthenticationAllowInactiveUser, SessionAuthenticationAllowInactiveUser) + authentication_classes = ( + JwtAuthentication, + OAuth2AuthenticationAllowInactiveUser, + SessionAuthenticationAllowInactiveUser, + ) permission_classes = (permissions.IsAuthenticated, IsUserInUrl) upload_media_types = set(itertools.chain(*(image_type.mimetypes for image_type in IMAGE_TYPES.values())))