From a74419214c0af03f3bd5af1e047e730fb47d9dcc Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 19 May 2021 23:10:00 +0200 Subject: [PATCH] providers/proxy: fix redirect_uris not always being set on save Signed-off-by: Jens Langhammer --- authentik/providers/proxy/api.py | 4 +++- authentik/providers/proxy/models.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/authentik/providers/proxy/api.py b/authentik/providers/proxy/api.py index 3cfb8e120..82a929c33 100644 --- a/authentik/providers/proxy/api.py +++ b/authentik/providers/proxy/api.py @@ -53,8 +53,10 @@ class ProxyProviderSerializer(ProviderSerializer): return instance def update(self, instance: ProxyProvider, validated_data): + instance = super().update(instance, validated_data) instance.set_oauth_defaults() - return super().update(instance, validated_data) + instance.save() + return instance class Meta: diff --git a/authentik/providers/proxy/models.py b/authentik/providers/proxy/models.py index 576b03a1c..0f668ab29 100644 --- a/authentik/providers/proxy/models.py +++ b/authentik/providers/proxy/models.py @@ -127,7 +127,7 @@ class ProxyProvider(OutpostModel, OAuth2Provider): """Ensure all OAuth2-related settings are correct""" self.client_type = ClientTypes.CONFIDENTIAL self.jwt_alg = JWTAlgorithms.RS256 - self.rsa_key = CertificateKeyPair.objects.first() + self.rsa_key = CertificateKeyPair.objects.exclude(key_data__iexact="").first() scopes = ScopeMapping.objects.filter( scope_name__in=[ SCOPE_OPENID,