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
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.