jitbit / AspNetSaml

Very simple SAML 2.0 consumer module for ASP.NET/C#
https://www.jitbit.com
Apache License 2.0
363 stars 117 forks source link

SignedXml CheckSignature issue #69

Closed jhabjan closed 1 year ago

jhabjan commented 1 year ago

For some reason CheckSignature is always returning false.

This is where I get certificate from:

jh-377

Only way I could get it working is to check the certificate I am receiving in the XML response from Azure:

jh-375

Is this right approach?

alex-jitbit commented 1 year ago

Yes, that's the right certificate link, it should look something like:

-----BEGIN CERTIFICATE-----
XXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXX
-----END CERTIFICATE-----

Not sure why it's not working, maybe you have your app connected more than once in Azure and you're using the wrong one?

jhabjan commented 1 year ago

Yep, that's what I have:

jh-379

It's definitely only 1 application.

alex-jitbit commented 1 year ago

I would contact MS support and ask why the two certificates are different (in the Azure panel and the one they send with their repsonse)

jhabjan commented 1 year ago

Yes, perhaps I should do that....

Here is what I have... the one is downloaded from azure and the other pulled out from the xml response.

jh-381

jaredthirsk commented 5 months ago

@jhabjan I'm running into the same problem. Did you ever figure out what's going on?

jaredthirsk commented 5 months ago

I think I figured it out. Instead of downloading from where you did, click the Edit in the top right and download from there instead. Then my IsValid() is true for me:

image