OWIN middleware: signout without redirecting to IdP when IdTokenHint is not available
OWIN middleware: signout without redirecting to IdP when IdTokenHint is not available
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.
1 Answer
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");
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Comments
Post a Comment