def METHOD_NAME(self, name: str, authorization_flow: Flow) -> SAMLProvider:
    """Create a SAMLProvider instance from the details. `name` is required,
    as depending on the metadata CertificateKeypairs might have to be created."""
    provider = SAMLProvider.objects.create(
        name=name,
        authorization_flow=authorization_flow,
    )
    provider.issuer = self.entity_id
    provider.sp_binding = self.acs_binding
    provider.acs_url = self.acs_location
    if self.signing_keypair and self.auth_n_request_signed:
        self.signing_keypair.name = f"Provider {name} - SAML Signing Certificate"
        self.signing_keypair.save()
        provider.verification_kp = self.signing_keypair
    if self.assertion_signed:
        provider.signing_kp = CertificateKeyPair.objects.exclude(key_data__iexact="").first()
    # Set all auto-generated Property-mappings as defaults
    # They should provide a sane default for most applications:
    provider.property_mappings.set(SAMLPropertyMapping.objects.exclude(managed__isnull=True))
    provider.save()
    return provider