From 12ae867759a7d6720b53076de96bfb0115035b3e Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 26 Dec 2020 18:58:18 +0100 Subject: [PATCH] providers/oauth2: redirect back on prompt=none error instead of showing message --- authentik/providers/oauth2/views/authorize.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/authentik/providers/oauth2/views/authorize.py b/authentik/providers/oauth2/views/authorize.py index af358b63e..57a7153aa 100644 --- a/authentik/providers/oauth2/views/authorize.py +++ b/authentik/providers/oauth2/views/authorize.py @@ -348,11 +348,10 @@ class AuthorizationFlowInitView(PolicyAccessView): if PROMPT_NONE in self.params.prompt and not self.request.user.is_authenticated: # When "prompt" is set to "none" but the user is not logged in, show an error message error = AuthorizeError( - self.params.redirect_uri, "interaction_required", self.params.grant_type - ) - raise RequestValidationError( - bad_request_message(self.request, error.description, title=error.error) + self.params.redirect_uri, "login_required", self.params.grant_type ) + raise RequestValidationError(redirect(error.create_uri( + self.params.redirect_uri, self.params.state))) def resolve_provider_application(self): client_id = self.request.GET.get("client_id")