ITfoxtec Saml2调用Bind报错:签名证书无RSA私钥(Azure AD .cer)
SAML2重定向登录请求绑定时报私钥缺失异常
我看过相关帖子,但没弄明白解答内容。我尝试用下面的示例代码实现将客户端重定向到登录提供商的登录功能:
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(); }
调用.Bind方法时抛出了如下异常:
No RSA Private Key present in Signing Certificate or missing private key read credentials.
我用的是Azure Active Directory提供的.cer文件,为什么会要求私钥?
补充 - 配置信息
我检查了appsettings,里面并没有SigningCertificateFile或SigningCertificatePassword属性,但还是出现了这个错误:
"Saml2": { "CertificateValidationMode": "None", // or "ChainTrust" "IdPMetadata": "...[redacted]...", "Issuer": "...[redacted]...", "RevocationMode": "NoCheck", "SignatureAlgorithm": "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256", },
内容的提问来源于stack exchange,提问作者Scott Baker
相关产品推荐
相关产品推荐

