Multi-tenant Configuration

Hi!! I am working on implementing 2 separate SAML services, as and am specifying our configuration programmatically in our Gloabal.asax.cs file on AppStart (used the example provided in the Examples), as shown below:
SAMLConfiguration samlConfiguration = new SAMLConfiguration();
samlConfiguration.LocalIdentityProviderConfiguration = new LocalIdentityProviderConfiguration()
{
Name = “<a href=“https://devclaims.zirmed.com/FISS_DDE/SAML/SSOService",">https://devclaims.zirmed.com/FISS_DDE/SAML/SSOService”,
Description = “ZirMed Dorado Identity Provider”,
LocalCertificateFile = “idp.pfx”,
LocalCertificatePassword = “password”
};

samlConfiguration.AddPartnerServiceProvider(
new PartnerServiceProviderConfiguration()
{
Name = “<a href=“https://zirmed-int.doradosystems.com:443”,”>https://zirmed-int.doradosystems.com:443”,
Description = “Dorado Service Provider”,
WantAuthnRequestSigned = true,
SignSAMLResponse = true,
SignAssertion = true,
EncryptAssertion = false,
SignatureMethod = "<a href=“http://www.w3.org/2000/09/xmldsig#rsa-sha1",">http://www.w3.org/2000/09/xmldsig#rsa-sha1”,
AssertionConsumerServiceUrl = "<a href=“https://zirmed-int.doradosystems.com/saml/login/callback",">https://zirmed-int.doradosystems.com/saml/login/callback”,
//SingleLogoutServiceUrl = "<a href=“http://localhost/ExampleServiceProvider/SAML/SLOService.aspx",">http://localhost/ExampleServiceProvider/SAML/SLOService.aspx”,
PartnerCertificateFile = “sp.cer”
});

SAMLController.Configurations[“Dorado”] = samlConfiguration;

samlConfiguration = new SAMLConfiguration();

samlConfiguration.LocalIdentityProviderConfiguration = new LocalIdentityProviderConfiguration()
{
Name = “<a href=“https://qaclaims.zirmed.com/Jopari/SAML/SSOService",">https://qaclaims.zirmed.com/Jopari/SAML/SSOService”,
Description = “ZirMed Jopari Identity Provider”,
LocalCertificateFile = “C:\Certificates\IdP\ZirMedEdi2012-03-19.pfx”,
LocalCertificatePassword = “z!rm@d3d1”
};

samlConfiguration.AddPartnerServiceProvider(
new PartnerServiceProviderConfiguration()
{
Name = “<a href=“https://zirmedqa.jopari.net”,”>https://zirmedqa.jopari.net”,
Description = “Jopari Service Provider”,
WantAuthnRequestSigned = true,
SignSAMLResponse = true,
SignAssertion = true,
EncryptAssertion = false,
SignatureMethod = "<a href=“http://www.w3.org/2000/09/xmldsig#rsa-sha1",">http://www.w3.org/2000/09/xmldsig#rsa-sha1”,
AssertionConsumerServiceUrl = "<a href=“https://zirmedqa.jopari.net/Shibboleth.sso/SAML2/POST",">https://zirmedqa.jopari.net/Shibboleth.sso/SAML2/POST”,
//SingleLogoutServiceUrl = "<a href=“http://localhost/ExampleServiceProvider2/SAML/SLOService.aspx",">http://localhost/ExampleServiceProvider2/SAML/SLOService.aspx”,
PartnerCertificateFile = “C:\Certificates\IdP\JopariSSO.cer”
});

SAMLController.Configurations[“Jopari”] = samlConfiguration;
}
However I am receiving an error in the trace:
ComponentSpace.SAML2 Verbose: 0 : 12232/8: 12/22/2016 10:33:51 AM: ComponentSpace.SAML2, Version=2.6.0.17, Culture=neutral, PublicKeyToken=7c51d97b3a0a8ff9, .NET v4.0 build (retail license).
ComponentSpace.SAML2 Verbose: 0 : 12232/8: 12/22/2016 10:33:51 AM: CLR: 4.0.30319.42000, OS: Microsoft Windows NT 6.1.7601 Service Pack 1, Account: IIS APPPOOL\zClmWebPortal, Culture: English (United States)
ComponentSpace.SAML2 Verbose: 0 : 12232/8: 12/22/2016 10:33:51 AM: Initializing the SAML environment.
ComponentSpace.SAML2 Verbose: 0 : 12232/8: 12/22/2016 10:33:51 AM: The Dorado SAML configuration has been loaded.
ComponentSpace.SAML2 Verbose: 0 : 12232/8: 12/22/2016 10:33:51 AM: The local identity provider is https://devclaims.zirmed.com/FISS_DDE/SAML/SSOService.
ComponentSpace.SAML2 Verbose: 0 : 12232/8: 12/22/2016 10:33:51 AM: The partner service provider is https://zirmed-int.doradosystems.com:443.
ComponentSpace.SAML2 Verbose: 0 : 12232/8: 12/22/2016 10:33:51 AM: The Jopari SAML configuration has been loaded.
ComponentSpace.SAML2 Verbose: 0 : 12232/8: 12/22/2016 10:33:51 AM: The local identity provider is https://qaclaims.zirmed.com/Jopari/SAML/SSOService.
ComponentSpace.SAML2 Verbose: 0 : 12232/8: 12/22/2016 10:33:51 AM: The partner service provider is https://zirmedqa.jopari.net.
ComponentSpace.SAML2 Verbose: 0 : 12232/8: 12/22/2016 10:33:51 AM: The SAML environment has been successfuly initialized.
ComponentSpace.SAML2 Verbose: 0 : 12232/8: 12/22/2016 10:33:51 AM: Exception: ComponentSpace.SAML2.Exceptions.SAMLConfigurationException: Multiple configurations are loaded and a SAML configuration ID hasn’t been specified.
ComponentSpace.SAML2 Verbose: 0 : 12232/8: 12/22/2016 10:33:51 AM: at ComponentSpace.SAML2.SAMLController.GetCurrentConfiguration()

I am needing assistance in where to specify which Configuration to use… Please note that in implementing this (High Level MVC approach) I already have a “SAMLController” to handle our SSOService action. Any assistance you can provide would be most helpful. We are using version 2.6.0.17 of the ComponentSpace.SAML2 dll

[quote]
Kpow - 12/22/2016
Hi!! I am working on implementing 2 separate SAML services, as and am specifying our configuration programmatically in our Gloabal.asax.cs file on AppStart (used the example provided in the Examples), as shown below:
SAMLConfiguration samlConfiguration = new SAMLConfiguration();
samlConfiguration.LocalIdentityProviderConfiguration = new LocalIdentityProviderConfiguration()
{
Name = "https://devclaims.zirmed.com/FISS_DDE/SAML/SSOService",
Description = "ZirMed Dorado Identity Provider",
LocalCertificateFile = "idp.pfx",
LocalCertificatePassword = "password"
};

samlConfiguration.AddPartnerServiceProvider(
new PartnerServiceProviderConfiguration()
{
Name = "https://zirmed-int.doradosystems.com:443",
Description = "Dorado Service Provider",
WantAuthnRequestSigned = true,
SignSAMLResponse = true,
SignAssertion = true,
EncryptAssertion = false,
SignatureMethod = "http://www.w3.org/2000/09/xmldsig#rsa-sha1",
AssertionConsumerServiceUrl = "https://zirmed-int.doradosystems.com/saml/login/callback",
//SingleLogoutServiceUrl = "http://localhost/ExampleServiceProvider/SAML/SLOService.aspx",
PartnerCertificateFile = "sp.cer"
});

SAMLController.Configurations["Dorado"] = samlConfiguration;

samlConfiguration = new SAMLConfiguration();

samlConfiguration.LocalIdentityProviderConfiguration = new LocalIdentityProviderConfiguration()
{
Name = "https://qaclaims.zirmed.com/Jopari/SAML/SSOService",
Description = "ZirMed Jopari Identity Provider",
LocalCertificateFile = "C:\\Certificates\\IdP\\ZirMedEdi2012-03-19.pfx",
LocalCertificatePassword = "z!rm@d3d1"
};

samlConfiguration.AddPartnerServiceProvider(
new PartnerServiceProviderConfiguration()
{
Name = "https://zirmedqa.jopari.net",
Description = "Jopari Service Provider",
WantAuthnRequestSigned = true,
SignSAMLResponse = true,
SignAssertion = true,
EncryptAssertion = false,
SignatureMethod = "http://www.w3.org/2000/09/xmldsig#rsa-sha1",
AssertionConsumerServiceUrl = "https://zirmedqa.jopari.net/Shibboleth.sso/SAML2/POST",
//SingleLogoutServiceUrl = "http://localhost/ExampleServiceProvider2/SAML/SLOService.aspx",
PartnerCertificateFile = "C:\\Certificates\\IdP\\JopariSSO.cer"
});

SAMLController.Configurations["Jopari"] = samlConfiguration;
}
However I am receiving an error in the trace:
ComponentSpace.SAML2 Verbose: 0 : 12232/8: 12/22/2016 10:33:51 AM: ComponentSpace.SAML2, Version=2.6.0.17, Culture=neutral, PublicKeyToken=7c51d97b3a0a8ff9, .NET v4.0 build (retail license).
ComponentSpace.SAML2 Verbose: 0 : 12232/8: 12/22/2016 10:33:51 AM: CLR: 4.0.30319.42000, OS: Microsoft Windows NT 6.1.7601 Service Pack 1, Account: IIS APPPOOL\zClmWebPortal, Culture: English (United States)
ComponentSpace.SAML2 Verbose: 0 : 12232/8: 12/22/2016 10:33:51 AM: Initializing the SAML environment.
ComponentSpace.SAML2 Verbose: 0 : 12232/8: 12/22/2016 10:33:51 AM: The Dorado SAML configuration has been loaded.
ComponentSpace.SAML2 Verbose: 0 : 12232/8: 12/22/2016 10:33:51 AM: The local identity provider is https://devclaims.zirmed.com/FISS_DDE/SAML/SSOService.
ComponentSpace.SAML2 Verbose: 0 : 12232/8: 12/22/2016 10:33:51 AM: The partner service provider is https://zirmed-int.doradosystems.com:443.
ComponentSpace.SAML2 Verbose: 0 : 12232/8: 12/22/2016 10:33:51 AM: The Jopari SAML configuration has been loaded.
ComponentSpace.SAML2 Verbose: 0 : 12232/8: 12/22/2016 10:33:51 AM: The local identity provider is https://qaclaims.zirmed.com/Jopari/SAML/SSOService.
ComponentSpace.SAML2 Verbose: 0 : 12232/8: 12/22/2016 10:33:51 AM: The partner service provider is https://zirmedqa.jopari.net.
ComponentSpace.SAML2 Verbose: 0 : 12232/8: 12/22/2016 10:33:51 AM: The SAML environment has been successfuly initialized.
ComponentSpace.SAML2 Verbose: 0 : 12232/8: 12/22/2016 10:33:51 AM: Exception: ComponentSpace.SAML2.Exceptions.SAMLConfigurationException: Multiple configurations are loaded and a SAML configuration ID hasn't been specified.
ComponentSpace.SAML2 Verbose: 0 : 12232/8: 12/22/2016 10:33:51 AM: at ComponentSpace.SAML2.SAMLController.GetCurrentConfiguration()

I am needing assistance in where to specify which Configuration to use... Please note that in implementing this (High Level MVC approach) I already have a "SAMLController" to handle our SSOService action. Any assistance you can provide would be most helpful. We are using version 2.6.0.17 of the ComponentSpace.SAML2 dll

[/quote]

Disregard. I've got it working correctly now. Thanks!

Just in case others wonder what the issue is, you need to specify which SAML configuration to use prior to calling any of the SAML SSO or SLO APIs.
This is done by setting the SAMLController.ConfigurationID to the name of the SAML configuration.
For example:
SAMLController.ConfigurationID = “Dorado”;
and then call the SAML API.