diff --git a/oauth2_provider/views/base.py b/oauth2_provider/views/base.py index 3e9a31269..e46e532c5 100644 --- a/oauth2_provider/views/base.py +++ b/oauth2_provider/views/base.py @@ -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() @@ -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 @@ -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) diff --git a/oauth2_provider/views/generic.py b/oauth2_provider/views/generic.py index d38fd14c6..b67cfa538 100644 --- a/oauth2_provider/views/generic.py +++ b/oauth2_provider/views/generic.py @@ -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 @@ -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):