【发布时间】:2018-07-19 14:27:29
【问题描述】:
我有几个使用同一个客户端由不同 URL 定义的租户
客户端 - c1
租户 - t1、t2、t3
所以,我们的用户可以使用不同的 URL 访问客户端
除了尝试单点退出之外,一切都很好。
According to the docs,我们将使用来自客户端的字段 FrontChannelLogoutUri 打开一个 IFrame 以清除该客户端的 cookie。
如果我们为上述任何域设置 FrontChannelLogoutUri,SSO 将适用于该租户,但不适用于其他租户
问题:我们如何从上述任何租户中注销?
我的想法是手动删除所有子域中的 ALL cookie,因此,使用 FrontChannelLogoutUri 作为 http://c1.com/logout-confirm,因此它将清除该域中的所有 cookie/子域
[HttpGet("logout-confirm")]
public async Task LogoutConfirm()
{
foreach (var cookie in Request.Cookies.Keys)
{
Response.Cookies.Delete(cookie);
}
HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
await
HttpContext.SignOutAsync(OpenIdConnectDefaults.AuthenticationScheme);
}
如果我们使用该 URL(在客户端表中定义)打开一个新选项卡,则此方法有效,但由于某种原因,IdentityServer 在执行注销时未使用该 URL 打开 IFrame。
有什么想法吗?
【问题讨论】:
-
我看到你在 github 上找到了解决方案。那你能关闭这个吗?
标签: c# asp.net-core single-sign-on identityserver4