Merge pull request #13896 from edx/ECOM-5769_enable_jwt

ECOM-5769 Add JWT auth and hidden flag to course_api for retrieving hidden courses
This commit is contained in:
Matthew Piatetsky
2016-11-04 10:26:57 -04:00
committed by GitHub
4 changed files with 22 additions and 1 deletions

View File

@@ -13,6 +13,7 @@ from rest_framework.response import Response
from rest_framework.mixins import RetrieveModelMixin, UpdateModelMixin
from rest_framework.generics import GenericAPIView
from edx_rest_framework_extensions.authentication import JwtAuthentication
from openedx.core.lib.api.authentication import (
SessionAuthenticationAllowInactiveUser,
OAuth2AuthenticationAllowInactiveUser,
@@ -93,6 +94,7 @@ def view_auth_classes(is_user=False, is_authenticated=True):
If is_user is True, also requires username in URL matches the request user.
"""
func_or_class.authentication_classes = (
JwtAuthentication,
OAuth2AuthenticationAllowInactiveUser,
SessionAuthenticationAllowInactiveUser
)