我们的IdP是Salesforce.com组织。SP是第三方.Net应用程序。在开发过程中,第3方报告他们无法验证发送的SAML响应。
我们决定尝试使用ComponentSpace进行验证,以验证SAML响应。以下是我们尝试的方法:
// Load the certificate from the file: certInFile
// Load the SAML in an XMLElement: samlXml
// Retrieve the certificate from the SAML: certInSaml
Console.WriteLine("SAML is valid ? " + SAMLResponse.IsValid(samlXml));
Console.WriteLine("Is SAML signed? " + SAMLMessageSignature.IsSigned(samlXml));
Console.WriteLine("Certificate found in SAML is same as certificate file? " + certInFile.Equals(certInSaml));
Console.WriteLine("Validated SAML with certificate found in SAML" + SAMLMessageSignature.Verify(samlXml, certInSaml));
Console.WriteLine("Validated SAML with certificate file" + SAMLMessageSignature.Verify(samlXml, certInFile));
除了最后两个以外,我对上述所有内容都是正确的。所以:
从3,4可以得出结论,Salesforce正在签名但具有不同的证书,但是在响应中发送了错误的公钥?
编辑:示例SAML在这里http://pastebin.com/J8FTxnhJ
我想念什么?
当我们不对生成的base64编码的SAML进行解码,而是直接尝试对其进行验证时,此方法有效。但是,仍然不确定为什么ComponentSpace方法对于解码后的字符串报告的结果有所不同。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句