【问题标题】:Why does my WIF logout not log me out of all RP web sites?为什么我的 WIFI 注销没有让我退出所有 RP 网站?
【发布时间】:2013-08-26 17:13:06
【问题描述】:

单点登录似乎适用于我的应用程序和许多其他共享 STS 的网站。当我退出我的应用程序时,我似乎正确地退出了我的站点;但是,我仍然可以访问使用相同 STS 的其他应用程序,而无需再次登录。谁能告诉我我错过了什么?

我的应用程序调用了所有东西,试图让它工作,但是当我只调用 FederatedSignOut 时行为是一样的。

FederatedAuthentication.SessionAuthenticationModule.SignOut();
FederatedAuthentication.SessionAuthenticationModule.DeleteSessionTokenCookie();
FederatedAuthentication.WSFederationAuthenticationModule.SignOut(false);
System.Web.Security.FormsAuthentication.SignOut();
WSFederationAuthenticationModule authModule = FederatedAuthentication.WSFederationAuthenticationModule;
WSFederationAuthenticationModule.FederatedSignOut(new Uri(authModule.Issuer), new Uri(authModule.Realm));

这是我的 STS 注销代码。

SignOutRequestMessage requestMessage = (SignOutRequestMessage)WSFederationMessage.CreateFromUri(Request.Url);
FederatedPassiveSecurityTokenServiceOperations.ProcessSignOutRequest(requestMessage, User, requestMessage.Reply, Response);

这是 STS 的问题,还是我的应用程序的问题?如果注销至少适用于我的应用程序,这是否可能是配置问题?我是否必须明确地向所有 RP 发送“wsignoutcleanup1.0”消息,还是应该 ProcessSignOutRequest 为我这样做?

【问题讨论】:

    标签: wif


    【解决方案1】:

    根据link,这是退出url的结构: https://{DNS_name_of_RP_STS}/adfs/ls/?wa=wsignout1.0&wreply={post-sign-out_landing_URL}

    直接调用它或将您的响应重定向到它。

    更新:或者您可以使用 SignOutRequestMessage 对象创建 URI。

    var fa = FederatedAuthentication.WSFederationAuthenticationModule;
    var signOutRequestMessage = new SignOutRequestMessage(new Uri(fa.Issuer), fa.Realm);
    var signOutURI = signOutRequestMessage.WriteQueryString();
    

    【讨论】:

      【解决方案2】:

      您可能已经猜到了,STS 和您的应用程序都创建了自己的会话 cookie,并且它们不能接触彼此的 cookie,这就是您需要 wsignoutcleanup1.0 消息的原因。

      在您的应用程序端,只需要调用 FederatedSignOut()。它会在重定向到 STS 之前为您删除您的应用程序会话 cookie,因此您拥有的所有其他内容都是多余的。

      但是,现在由您的 STS 在某个注销端点正确接收和处理传入的 wsignoutcleanup1.0 请求。听起来你的不是。我首先要确认你的这个 STS 代码实际上被击中了。如果它被击中,但 STS 会话 cookie 仍然存在,那么有其他问题。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-05-16
        • 2013-01-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-11-28
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多