SAML Request not being sent on server

I am coding an old webforms application to use SAML authentication, and I’m having a problem that I cannot seem to find a cause, let alone a solution for.

This is a problem that only occurs on IIS or Azure, but not on localhost. Basically, when I click the button that is supposed to send the saml request to the IdP, it seems to instead reload the page, but the browser is blank unless I refresh. Digging deeper, when I open up the page inspector on Chrome, the network tab indicates that when the button is pressed, the Post has a status code of 200 rather than 302 which is what I’d expect with a SAML redirect.

I honestly don’t even know where to look and none of the other developers on my team has a clue what is going on. We assume the issue to be code related, but that’s about it.


On the page where you call SAMLServiceProvider.InitiateSSO, are you writing to the HTTP response? If so, this can override the 302 that we’re attempting to return with a 200 response.

Also, take a look at the ExampleServiceProvider project under the Examples\SSO\WebForms folder and compare the code where it calls SAMLServiceProvider.InitiateSSO with your code.

Let us know what you find. Thanks.