Add prompt parameter to authorize view.
This commit is contained in:
parent
32950bc655
commit
b05894bf6d
2 changed files with 7 additions and 3 deletions
|
@ -55,6 +55,7 @@ class AuthorizeEndpoint(object):
|
|||
self.params.scope = query_dict.get('scope', '').split()
|
||||
self.params.state = query_dict.get('state', '')
|
||||
self.params.nonce = query_dict.get('nonce', '')
|
||||
self.params.prompt = query_dict.get('prompt', '')
|
||||
|
||||
# PKCE parameters.
|
||||
self.params.code_challenge = query_dict.get('code_challenge')
|
||||
|
@ -91,7 +92,7 @@ class AuthorizeEndpoint(object):
|
|||
raise RedirectUriError()
|
||||
|
||||
# PKCE validation of the transformation method.
|
||||
if self.params.code_challenge and self.params.code_challenge_method:
|
||||
if self.params.code_challenge:
|
||||
if not (self.params.code_challenge_method in ['plain', 'S256']):
|
||||
raise AuthorizeError(self.params.redirect_uri, 'invalid_request', self.grant_type)
|
||||
|
||||
|
|
|
@ -67,6 +67,9 @@ class AuthorizeView(View):
|
|||
}
|
||||
|
||||
return render(request, 'oidc_provider/authorize.html', context)
|
||||
else:
|
||||
if authorize.params.prompt == 'none':
|
||||
raise AuthorizeError(authorize.params.redirect_uri, 'login_required', authorize.grant_type)
|
||||
else:
|
||||
path = request.get_full_path()
|
||||
return redirect_to_login(path)
|
||||
|
|
Loading…
Reference in a new issue