Sustainsys / Saml2

Saml2 Authentication services for ASP.NET
Other
951 stars 601 forks source link

ForceAuthentication not setting ForceAuthn flag #1314

Closed shweinfeld closed 2 years ago

shweinfeld commented 2 years ago

I'm working on a .NET MVC application. I need to Force Authentication. I looked through the previous issues that dealt with this and tried adding the following code to Startup.cs and Global.asax.cs, both of which have no effect on the SAML Request. Any guidance would be appreciated.

Sustainsys.Saml2.Mvc.Saml2Controller.Options.Notifications.AuthenticationRequestCreated = (request, provider, dictionary) =>
            {
                request.ForceAuthentication = true;
            };
AndersAbel commented 2 years ago

Can you set a breakpoint to validate if the code in the notification is run?

AndersAbel commented 2 years ago

Won't fix any bugs in 1.x or 2.x, hopefully won't write buggy code in the next version.