Closed CalvinPangch closed 2 years ago
Which .NET version you're on?
.NetFramework 4.5.2
I had comment the code signedXml.CheckSignature(_certificate, true) and its work as expected .
do we really need the checkSignature ? what will happen if we don't checkSignature ?
I had solved the issue. just add this line. CryptoConfig.AddAlgorithm(typeof(RSAPKCS1SHA256SignatureDescription), "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256");
the solution can be found in below links : https://stackoverflow.com/questions/16728558/signed-xml-signature-verification-for-sso-saml-using-sha256
Thank you.
I could get the SAML response,
when hit the code samlResponse.IsValid(), then i got the error message as below :
SignatureDescription could not be created for the signature algorithm suppliedSystem.Security.Cryptography.CryptographicException: SignatureDescription could not be created for the signature algorithm supplied. at System.Security.Cryptography.Xml.SignedXml.CheckSignedInfo(AsymmetricAlgorithm key) at System.Security.Cryptography.Xml.SignedXml.CheckSignature(AsymmetricAlgorithm key) at System.Security.Cryptography.Xml.SignedXml.CheckSignature(X509Certificate2 certificate, Boolean verifySignatureOnly) at Testing.Security.SAML.SSOSignIn.Response.IsValid()
could you please help. Thank you.