When trying to dynamically pull the certificate from the database, I receive this error:
The X.509 certificate with find type: FindByThumbprint and find value: xxxxxxxxxxxxxxxxxxxxxxxxxx could not be found in the X.509 store LocalMachine.
What am I doing wrong? We are new to Component Space and trying to figure out if it will work for our needs.
string ssoURL = "<a href=“https://test1.com/samlservice";">https://test1.com/samlservice”;
string providerName = “test1”;
string assertionURL = "<a href=“http://test2.com/samlAssertion.aspx";">http://test2.com/samlAssertion.aspx”;
string serviceName = “test2”;
var config = new SAMLConfiguration();
PartnerIdentityProviderConfiguration pId = new PartnerIdentityProviderConfiguration();
pId.SingleSignOnServiceUrl = ssoURL;
pId.Name = providerName;
pId.WantSAMLResponseSigned = true;
pId.WantAssertionSigned = false;
pId.WantAssertionEncrypted = false;
pId.SignAuthnRequest = false;
X509Certificate2 x509Certificate = new X509Certificate2(GetCertBytes());
pId.PartnerCertificateThumbprint = x509Certificate.Thumbprint;
config.AddPartnerIdentityProvider(pId);
LocalServiceProviderConfiguration sId = new LocalServiceProviderConfiguration();
sId.AssertionConsumerServiceUrl = assertionURL;
sId.Name = serviceName;
config.LocalServiceProviderConfiguration = sId;
SAMLConfiguration.Current = config;