I've run into an issue using Sustainsys.Saml2 library to authenticate to MS Entra using Saml2. This question seems to have been asked many times. I've looked through many online posts with the same issues as me on here and Microsoft and still can't find a solution. I'm either not doing something specific to .NET Framework 4.7.2 or haven't truly found my issue.
I'm getting the following error:
Received message _a80178a3-d538-4b8e-a538-5fbbef823aca contains unexpected InResponseTo "iddbc74838186f4f58a236105450827f37". No cookie preserving state from the request was found so the message was not expected to have an InResponseTo attribute. This error typically occurs if the cookie set when doing SP-initiated sign on have been lost.
Here's what I got:
SameSite
value(s) to nothing or "Unspecified" for the cookies using ht following articles:
https://learn.microsoft.com/en-us/aspnet/samesite/csharpwebforms
No cookie error in chrome. UnexpectedInResponseToExceptionThis solution works just fine on production, which runs an Azure App Service, but does not work on our local machines.
Thanks for your help.
After testing many different things, I tried to focus on certificates. I was using wildcard certificates like this: *.abc.com
. Even with the certificate trusted it was not working.
Once I created a new certificate for local.abc.com
and trusted those, everything worked just fine.
My next venture, if possible, how can I use a wildcard certificate? We have several websites with subdomains of our abc.com
domain, that we'd prefer working with just one vs 10 or 20.