OWIN middleware: signout without redirecting to IdP when IdTokenHint is not available

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP

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

Popular posts from this blog

Executable numpy error

PySpark count values by condition

Mass disable jenkins jobs