问题描述
我正在使用身份服务器 Version="4.0.0" 我想在客户端注销时实现所有客户端的注销。我正在尝试 backoutchannel 注销
例如: - 我有以下应用程序 URL 连接到 IS。当客户端 MVC1 从 URL https://localhost:5002/ 注销时,其他客户端也应该注销。我查看了他们所说的 IS 文档以添加 backoutchannelURL
- https://localhost:5002/(客户端:MVC1,BackChannellogoutUri:https://localhost:5002/home/logout)
- https://localhost:5003/(客户端:MVC2,BackChannellogoutUri:https://localhost:5003/home/logout)
- https://localhost:5004/(客户端:MVC3,BackChannellogoutUri:https://localhost:5004/home/logout)
IS--> accountController
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> logout(logoutInputModel model)
{
// build a model so the logged out page kNows what to display
var vm = await BuildLoggedOutviewmodelAsync(model.logoutId);
if (User?.Identity.IsAuthenticated == true)
{
// delete local authentication cookie
await HttpContext.SignOutAsync();
// raise the logout event
await _events.RaiseAsync(new UserlogoutSuccessEvent(User.GetSubjectId(),User.GetdisplayName()));
}
// check if we need to trigger sign-out at an upstream identity provider
if (vm.TriggerExternalSignout)
{
// build a return URL so the upstream provider will redirect back
// to us after the user has logged out. this allows us to then
// complete our single sign-out processing.
string url = Url.Action("logout",new { logoutId = vm.logoutId });
// this triggers a redirect to the external provider for sign-out
return SignOut(new AuthenticationProperties { RedirectUri = url },vm.ExternalAuthenticationScheme);
}
return View("LoggedOut",vm);
}
MVC 应用程序 --> 主页/注销
[HttpPost("logout")]
[AllowAnonymous]
public IActionResult Backchannellogout()
{
return SignOut("Cookies","oidc");
}
知道为什么它不起作用吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)