I've already read this related post and if it answers the question, I don't understand it.
I'm trying to use this code to login to redirect the client to the login provider - it's pretty much the boilerplate from the samples:
public IActionResult RedirectToLogin(LoginInfo loginInfo)
{
var binding = new Saml2RedirectBinding();
var roundTripInfo = new Dictionary<string, string>
{
// some stuff
};
binding.SetRelayStateQuery(roundTripInfo);
return binding.Bind(new Saml2AuthnRequest(config)).ToActionResult();
}
but the .Bind method is throwing this exception:
No RSA Private Key present in Signing Certificate or missing private key read credentials.
I am using a .cer file provided by the Azure Active Directory I'm trying to access - why would it need a private key?
EDIT - Appsettings
I checked my appsettings it doesn't even contain the SigningCertificateFile or SigningCertificatePassword properties, but I am still getting the error:
"Saml2": {
"CertificateValidationMode": "None", // or "ChainTrust"
"IdPMetadata": "...[redacted]...",
"Issuer": "...[redacted]...",
"RevocationMode": "NoCheck",
"SignatureAlgorithm": "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256",
},