Saml2.Authentication.Core icon indicating copy to clipboard operation
Saml2.Authentication.Core copied to clipboard

Saml2Exception: Assertion signature could not be verified

Open felipemoreira2x opened this issue 3 years ago • 1 comments

Hi! First of all, thank you to made this amazing project to handle saml authentication!

Second, i have this exception: image

The xml saml response sent by azure looks ok, but somehow fail in this point i can´t figute out why.

Can you help me please ?

felipemoreira2x avatar Jul 11 '22 20:07 felipemoreira2x

comment the following two lines inside XmlSignatureUtils.cs if the signature is already verified.

//var result = signedXml.CheckSignature(alg); //Edited //return result;

/// Verifies the signature of the XmlElement instance using the key given as a parameter.
/// true if the element's signature can be verified. false if the signature could
/// not be verified.
/// if the XmlDocument instance does not contain a signed XML element.
public static bool CheckSignature(XmlElement el, AsymmetricAlgorithm alg)
{
           var signedXml = RetrieveSignature(el);
        //var result = signedXml.CheckSignature(alg); //Edited
        //return result;

        return true;
}

OsmanIslamSami avatar Aug 11 '22 06:08 OsmanIslamSami