Multiple PartnerServiceProvider defined and wrong one is being used

I have created a saml.config file with multiple PartnerServiceProvider entries as below:

<PartnerServiceProvider Name=“SP1” …

<PartnerServiceProvider Name=“SP2” …

but when I make the call:
SAMLIdentityProvider.InitiateSSO(Response, User.Identity.Name, null, null, “SP1”);

it is actually trying to use the certificate defined for SP2 and causing issues.
I have done everything and it always wants to use SP2, the only way I was able to get it to use SP1 correctly was if I delete SP2 and SP1 is the only one available in which case even if I specify NULL for the last parameter it works as well.

Any ideas? suggestions?

Please enable SAML trace and send the generated log file as an email attachment to our support.
http://www.componentspace.com/Forums/17/Enabing-SAML-Trace
Also include your saml.config file with any passwords removed.
Please mention this topic.

[quote]
ComponentSpace - Friday, August 12, 2016
Please enable SAML trace and send the generated log file as an email attachment to our support.
http://www.componentspace.com/Forums/17/Enabing-SAML-Trace
Also include your saml.config file with any passwords removed.
Please mention this topic.
[/quote]

My bad... after I created the trace file to send to you, I examined it and the issue was that my SP2 had a certificate file which I hadn't created yet as I wasn't planning to use it yet, and from the log file it looks like the during ComponentSpace initialization it read everthing from the config file and load everything including the certificates in to cache and as SP2 certificate didn't exist yet, it was causing problems. I didn't realize I had to have everything in the config file available even though I wasn't explicitly using it yet.

It is all resolved now, thank you for your help.

Thanks for the update and I’m glad you found the issue.