diff --git a/authentik/providers/saml/forms.py b/authentik/providers/saml/forms.py index 437d0898b..a5373ce46 100644 --- a/authentik/providers/saml/forms.py +++ b/authentik/providers/saml/forms.py @@ -94,6 +94,9 @@ class SAMLProviderImportForm(forms.Form): """Create a SAML Provider from SP Metadata.""" provider_name = forms.CharField() + authorization_flow = forms.ModelChoiceField( + queryset=Flow.objects.filter(designation=FlowDesignation.AUTHORIZATION) + ) metadata = forms.FileField( validators=[FileExtensionValidator(allowed_extensions=["xml"])] ) diff --git a/authentik/providers/saml/views.py b/authentik/providers/saml/views.py index 6cd7884bc..82047b62a 100644 --- a/authentik/providers/saml/views.py +++ b/authentik/providers/saml/views.py @@ -270,6 +270,7 @@ class MetadataImportView(LoginRequiredMixin, FormView): form.cleaned_data["metadata"].read().decode() ) provider = metadata.to_provider(form.cleaned_data["provider_name"]) + provider.authorization_flow = form.cleaned_data["authorization_flow"] provider.save() messages.success(self.request, _("Successfully created Provider")) except ValueError as exc: