diff --git a/oidc_provider/lib/endpoints/authorize.py b/oidc_provider/lib/endpoints/authorize.py index 6972728..0ae86d9 100644 --- a/oidc_provider/lib/endpoints/authorize.py +++ b/oidc_provider/lib/endpoints/authorize.py @@ -82,8 +82,6 @@ class AuthorizeEndpoint(object): def create_response_uri(self): try: - self.validate_params() - if self.grant_type == 'authorization_code': code = create_code( user=self.request.user, @@ -95,7 +93,7 @@ class AuthorizeEndpoint(object): # Create the response uri. uri = self.params.redirect_uri + '?code={0}'.format(code.code) - else: # Implicit Flow + elif self.grant_type == 'implicit': id_token_dic = create_id_token( user=self.request.user, aud=self.client.client_id) diff --git a/oidc_provider/views.py b/oidc_provider/views.py index b214c57..85f783f 100644 --- a/oidc_provider/views.py +++ b/oidc_provider/views.py @@ -73,6 +73,8 @@ class AuthorizeView(View): allow = True if request.POST.get('allow') else False try: + authorize.validate_params() + if not allow: raise AuthorizeError(authorize.params.redirect_uri, 'access_denied',