简体   繁体   English

身份服务器单次注销,也从服务器注销

[英]Identity server single sign out, logout from server too

Here is my logout code that I use in relying party: 这是我在依赖方中使用的注销代码:

    FederationConfiguration cfg = FederatedAuthentication.FederationConfiguration;
    var fam = FederatedAuthentication.WSFederationAuthenticationModule;
    fam.SignOut(false);
    var signOutRequestMessage = new SignOutRequestMessage(new Uri(fam.Issuer), fam.Realm);
    return new RedirectResult(signOutRequestMessage.WriteQueryString());

And get logout from RP and redirected to Identity server "Signed out" page, but I still remain logged in at Identity server, is this expected behaviour? 并从RP注销并重定向到Identity Server的“ Signed out”页面,但是我仍然保持登录状态,这是预期的行为吗? How can I change this so I get logged out from Identity server also? 如何更改此设置,以便也从身份服务器注销?

It depends how the IdentityServer is doing authentication. 这取决于IdentityServer进行身份验证的方式。 If it's cookie based, then you should be logged out but if it's using something like integrated windows auth, then you're going to get automatically logged back in. 如果基于cookie,则应该注销,但是如果使用集成的Windows auth之类的东西,那么您将自动重新登录。

I've modified HRDController: 我修改了HRDController:

 private ActionResult ShowSignOutPage(string returnUrl)
 {
   ....
   FederatedAuthentication.SessionAuthenticationModule.DeleteSessionTokenCookie(); //added this
   return View("Signout", realms);
 }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM