Add JWT auth and hidden flag to course_api

This commit is contained in:
Matthew Piatetsky
2016-11-02 15:30:44 -04:00
parent 0016d1af4e
commit af976a0ef5
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
)