SignedXml checksignature returns false

前端 未结 4 794
长发绾君心
长发绾君心 2021-02-08 12:53

I\'ve looked at other posts on here regarding this issue and none of them seem to address my situation.

I\'ve been trying to verify a SAML assertion for the last week an

4条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-08 13:26

    I just had a similar issue and lost a lot of time, maybe this can help someone.

    My environment is 100% .Net 4.5, and my code uses only the SignedXml class. But a SAML assertion was accepted at one place and refused at another one.

    Turned out that one place was loading the assertion through an XmlDocument instance initialized with PreserveWhitespace = true, while the other one was not.

    And the assertion had been pretty-printed, so it had carriage returns and a lot of indentation spaces. Removing all carriage returns and the indentation spaces fixed my issue.

提交回复
热议问题