I am using ComponentSpace.Saml2 version 2.0.4
When I set LocalCertificates like this:
LocalCertificates = new List<Certificate>
{
new Certificate
{
Use = "Any",
String = "MIIGYPtBAzCCBgc...",
Password = "MyPassword"
}
}
It works fine on my local machine, but when I deploy it to an Azure Windows App Service I get the following error:
System.Security.Cryptography.CryptographicException: The system cannot find the file specified.
at System.Security.Cryptography.CngKey.Open(String keyName, CngProvider provider, CngKeyOpenOptions openOptions)
at System.Security.Cryptography.X509Certificates.CertificatePal.GetPrivateKey[T](Func2 createCsp, Func
2 createCng)
at System.Security.Cryptography.X509Certificates.CertificateExtensionsCommon.GetPrivateKey[T](X509Certificate2 certificate, Predicate1 matchesConstraints) at ComponentSpace.Saml2.SamlIdentityProvider.CreateSamlResponseAsync(String userID, IList
1 attributes, String authnContext, Status status, String assertionConsumerServiceUrl)
at ComponentSpace.Saml2.SamlIdentityProvider.InitiateSsoAsync(String partnerName, String userID, IList`1 attributes, String relayState, String authnContext)
I think I am running into the issue identified here:
Troubleshooting Loading X.509 Certificates - SAML for ASP.NET - ComponentSpace Support Forum
I am unsure how to resolve this?