diff --git a/authentik/providers/saml/processors/metadata_parser.py b/authentik/providers/saml/processors/metadata_parser.py index 91425cf51..3f392b4c4 100644 --- a/authentik/providers/saml/processors/metadata_parser.py +++ b/authentik/providers/saml/processors/metadata_parser.py @@ -74,7 +74,7 @@ class ServiceProviderMetadata: # Set all auto-generated Property-mappings as defaults # They should provide a sane default for most applications: provider.property_mappings.set( - SAMLPropertyMapping.objects.filter(name__startswith="Autogenerated") + SAMLPropertyMapping.objects.exclude(managed__isnull=True) ) provider.save() return provider diff --git a/authentik/providers/saml/tests/test_metadata.py b/authentik/providers/saml/tests/test_metadata.py index 512ffd0e5..29dc74b36 100644 --- a/authentik/providers/saml/tests/test_metadata.py +++ b/authentik/providers/saml/tests/test_metadata.py @@ -78,7 +78,7 @@ class TestServiceProviderMetadataParser(TestCase): self.assertEqual(provider.sp_binding, SAMLBindings.POST) self.assertEqual( len(provider.property_mappings.all()), - len(SAMLPropertyMapping.objects.filter(name__startswith="Autogenerated")), + len(SAMLPropertyMapping.objects.exclude(managed__isnull=True)), ) def test_with_signing_cert(self):