Secure Your ASP.NET Web Forms Application with OpenID Connect and Okta

Stuart Smith

Anybody with issues with logout use this in the following:
protected void Unnamed_LoggingOut(object sender, LoginCancelEventArgs e)
{
HttpContext context = HttpContext.Current;
if (context.User.Identity.IsAuthenticated)
{
context.GetOwinContext().Authentication.SignOut(CookieAuthenticationDefaults.AuthenticationType, OpenIdConnectAuthenticationDefaults.AuthenticationType);
Response.Redirect(“Default.aspx”);
}
}