0

Is there anyway to signout using OWIN middleware without redirecting to IdP? Everytime i call Authentication.SignOut(), my MVC application is redirecting to IdP. It's fine if the identity token is available. However I don't want user to get stuck on IdentityServer's logout screen when identity token is gone without knowing how to come back to login screen.

h2chch
  • 21
  • 5

1 Answers1

1

It turns out i just handle LogoutRequest event on RedirectToIdentityProvider and use following lines of code to redirect user to front-channel logout page:

if (identityToken != null)
{
    n.ProtocolMessage.IdTokenHint = identityToken;
}
else
{
    n.HandleResponse();
    n.Response.Redirect("/Account/FrontChannelLogout"); 
}
h2chch
  • 21
  • 5