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
Had a similar issue with Saml as Timores. The Saml needed to be decoded from Base64 but first i used:
var saml = System.Text.Encoding.Default.GetString(Convert.FromBase64String(samlToken))
But this used ASCII decoding and had trouble with special characters. Which means the XML was slightly different from when it was signed and that is why it failed. Changed it to:
var saml = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(samlToken))
and it worked for all cases.
So be sure that you are using the right encoding!