Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions oauth2_provider/views/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from ..exceptions import OAuthToolkitError
from ..forms import AllowForm
from ..models import get_application_model
from ..oauth2_validators import OAuth2Validator
from .mixins import OAuthLibMixin

Application = get_application_model()
Expand Down Expand Up @@ -67,7 +66,7 @@ class AuthorizationView(BaseAuthorizationView, FormView):
form_class = AllowForm

server_class = Server
validator_class = OAuth2Validator
validator_class = oauth2_settings.OAUTH2_VALIDATOR_CLASS

def get_initial(self):
# TODO: move this scopes conversion from and to string into a utils function
Expand Down Expand Up @@ -129,7 +128,7 @@ class TokenView(CsrfExemptMixin, OAuthLibMixin, View):
* Client credentials
"""
server_class = Server
validator_class = OAuth2Validator
validator_class = oauth2_settings.OAUTH2_VALIDATOR_CLASS

def post(self, request, *args, **kwargs):
url, headers, body, status = self.create_token_response(request)
Expand Down
4 changes: 2 additions & 2 deletions oauth2_provider/views/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from oauthlib.oauth2 import Server

from ..oauth2_validators import OAuth2Validator
from ..settings import oauth2_settings
from .mixins import ProtectedResourceMixin, ScopedResourceMixin, ReadWriteScopedResourceMixin


Expand All @@ -11,7 +11,7 @@ class ProtectedResourceView(ProtectedResourceMixin, View):
Generic view protecting resources by providing OAuth2 authentication out of the box
"""
server_class = Server
validator_class = OAuth2Validator
validator_class = oauth2_settings.OAUTH2_VALIDATOR_CLASS


class ScopedProtectedResourceView(ScopedResourceMixin, ProtectedResourceView):
Expand Down