Multiple SAML configurations exist but a configuration name hasn't been specified

Hi,
We have a multi tenant web app using ComponentSpace for SSO.
There are multiple configurations that we add when the app starts:

public void ConfigureServices(IServiceCollection services)
{
services.AddSaml(ConfigureSaml);
}

public static void ConfigureSaml(SamlConfigurations samlConfigurations)
{
var ssoClients = …;

samlConfigurations.Configurations = ssoClients.Select(ssoClient => new SamlConfiguration
{
Name = ssoClient.ClientId,
PartnerIdentityProviderConfigurations = new List
{
new ()
{
Name = ssoClient.PartnerIdentityProviderName,
SignAuthnRequest = ssoClient.SignAuthnRequest,
WantSamlResponseSigned = ssoClient.WantSAMLResponseSigned,
WantAssertionSigned = ssoClient.WantAssertionSigned,
WantAssertionEncrypted = ssoClient.WantAssertionEncrypted,
SingleSignOnServiceUrl = ssoClient.PartnerIdentityLoginUrl,
SingleLogoutServiceUrl = ssoClient.PartnerIdentityLogoutUrl,
DigestAlgorithm = ssoClient.DigestMethod,
SignatureAlgorithm = ssoClient.SignatureMethod,
PartnerCertificates = new List
{
new()
{
String = ssoClient.CertificateString
}
},
DisableDestinationCheck = ssoClient.DisableDestinationCheck
}
},
LocalServiceProviderConfiguration = new LocalServiceProviderConfiguration
{
Name = ssoClient.LocalServiceProviderName,
AssertionConsumerServiceUrl = …
}
}).ToList();
}

It is an IDP initiated SSO and our app is a SP. So in the login controller action we have:


_samlServiceProvider.SetConfigurationNameAsync(currentConfiguration.ClientId);

var ssoResult = _samlServiceProvider.ReceiveSsoAsync();


Here is what we see in the log:

2022-11-14 15:46:05 DEBUG - The configuration name has been set to XXX. (correct)
2022-11-14 15:46:05 ERROR - Receiving an SSO response from a partner identity provider has failed.
ComponentSpace.Saml2.Exceptions.SamlConfigurationException: Multiple SAML configurations exist but a configuration name hasn’t been specified.
at ComponentSpace.Saml2.Configuration.Resolver.SamlConfigurationResolver.GetConfiguration(String configurationName)
at ComponentSpace.Saml2.Configuration.Resolver.SamlConfigurationResolver.GetLocalServiceProviderConfigurationAsync(String configurationName)
at ComponentSpace.Saml2.SamlServiceProvider.GetLocalSpConfigurationAsync()
at ComponentSpace.Saml2.SamlServiceProvider.ReceiveSsoAsync()

Please advise.

Thanks,
Alex.


Hi Alex,

I don’t see any obvious issues.

Please send the SAML log file as an email attachment to support@componentspace.com so we can take a closer look.