From 48fcb1da9331782103100a312a8dfe223f8757d8 Mon Sep 17 00:00:00 2001 From: juanifioren Date: Mon, 15 Jun 2015 17:34:36 -0300 Subject: [PATCH] Move validate_params function to views (on POST authorize). --- oidc_provider/lib/endpoints/authorize.py | 4 +--- oidc_provider/views.py | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) 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',