OWIN中间件:当IdTokenHint不可用时,注销而不重定向到IdP



是否可以在不重定向到IdP的情况下使用OWIN中间件注销?每次我调用Authentication.SignOut((时,我的MVC应用程序都会重定向到IdP。如果身份令牌可用,也没关系。然而,我不希望用户在不知道如何返回登录屏幕的情况下,当身份令牌消失时,被困在IdentityServer的注销屏幕上。

事实证明,我只是在RedirectToIdentityProvider上处理LogoutRequest事件,并使用以下代码行将用户重定向到前通道注销页面:

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

最新更新