0

我正在使用身份服务器 Version="4.0.0" 我想在客户端注销时实现所有客户端的注销。我正在尝试 backoutchannel 注销

例如: - 我将以下应用程序 URL 连接到 IS。当客户端 MVC1 从 URL https://localhost:5002/ 注销时,其他客户端也应该注销。我浏览了他们说要添加 backoutchannelURL 的 IS 文档

  1. https://localhost:5002/(客户端:MVC1,BackChannelLogoutUri:https://localhost:5002/home/logout)
  2. https://localhost:5003/(客户端:MVC2,BackChannelLogoutUri:https://localhost:5003/home/logout)
  3. 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");
    }

关于它为什么不起作用的任何想法?

4

0 回答 0