注销不起作用后,我正在使用IdenetityServer4并重定向到MVC客户端。以下是我的MVC客户端控制器注销操作:IdentityServer4 - 注销后重定向到MVC客户端
public async Task Logout()
{
await HttpContext.Authentication.SignOutAsync("Cookies");
await HttpContext.Authentication.SignOutAsync("oidc");
}
以下是身份服务器4主机配置文件。
public static IEnumerable<Client> GetClients()
{
return new List<Client>
{
// other clients omitted...
// OpenID Connect implicit flow client (MVC)
new Client
{
ClientId = "mvc",
ClientName = "MVC Client",
AllowedGrantTypes = GrantTypes.Implicit,
// where to redirect to after login
RedirectUris = { "http://localhost:58422/signin-oidc" },
// where to redirect to after logout
PostLogoutRedirectUris = { "http://localhost:58422/signout-callback-oidc" },
AllowedScopes = new List<string>
{
IdentityServerConstants.StandardScopes.OpenId,
IdentityServerConstants.StandardScopes.Profile
}
}
};
}
我想让用户在从IdentityServer注销后重定向回MVC客户端。现在用户必须点击下面图片中的链接显示重定向到MVC网站,但我认为用户应该被自动重定向回MVC客户端。
份额错误,请和其他日志。 – Lutando