From 70d0dd51a5764670ed70d690fdd9c46f92b2b6fc Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 7 Sep 2021 11:03:45 +0200 Subject: [PATCH] sources/oauth: cancel currently active flows before redirecting out Signed-off-by: Jens Langhammer --- authentik/sources/oauth/views/redirect.py | 2 ++ internal/outpost/proxy/proxy.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/authentik/sources/oauth/views/redirect.py b/authentik/sources/oauth/views/redirect.py index 39f1faa8b..5d7e06d32 100644 --- a/authentik/sources/oauth/views/redirect.py +++ b/authentik/sources/oauth/views/redirect.py @@ -6,6 +6,7 @@ from django.urls import reverse from django.views.generic import RedirectView from structlog.stdlib import get_logger +from authentik.flows.views import FlowExecutorView from authentik.sources.oauth.models import OAuthSource from authentik.sources.oauth.views.base import OAuthClientMixin @@ -42,4 +43,5 @@ class OAuthRedirect(OAuthClientMixin, RedirectView): raise Http404(f"source {slug} is not enabled.") client = self.get_client(source, callback=self.get_callback_url(source)) params = self.get_additional_parameters(source) + FlowExecutorView().cancel() return client.get_redirect_url(params) diff --git a/internal/outpost/proxy/proxy.go b/internal/outpost/proxy/proxy.go index 9a5b22374..5ead7895f 100644 --- a/internal/outpost/proxy/proxy.go +++ b/internal/outpost/proxy/proxy.go @@ -121,7 +121,7 @@ func NewOAuthProxy(opts *options.Options, provider api.ProxyOutpostConfig, c *ht redirectURL.Path = fmt.Sprintf("%s/callback", opts.ProxyPrefix) } - logger.WithField("auth_url", opts.GetProvider().Data().LoginURL).WithField("client_id", opts.ClientID).Info("proxy instance configured") + logger.WithField("auth_url", opts.GetProvider().Data().LoginURL.String()).WithField("client_id", opts.ClientID).Info("proxy instance configured") sessionChain := buildSessionChain(opts, sessionStore)