AzureADQuickStarts / AppModelv2-WebApp-OpenIDConnect-DotNet

ASP.NET Web Server - OpenID Connect v2 Endpoint Sample
Apache License 2.0
96 stars 91 forks source link

Writing to Session disrupts ASP.NET MVC OpenId SignIn #38

Open ameleta-alsco opened 3 years ago

ameleta-alsco commented 3 years ago

Trying to understand why writing to Session with OpenId Connect disrupts the Sign In process.

For example, if I modify HomeController the way below, the SignIn stops working; By SignIn, it will redirect you to Azure AD and return to the Index unauthenticated.

public ActionResult Index()
{
    Session["TEST"] = "TEST"; // Let's make a SignIn disruption
    return View();
}

Removing the code during debug will not rectify the process, only if you restart the app. Any solution or workaround?