1

我正在使用 STS 来控制 SSO。我有一个 STS 站点和两个客户端站点应用程序(站点 a、站点 b)。

站点 a 和站点 b 都添加了 STS 站点作为其 STS 参考。单点登录工作正常,我只能登录一次,但是单点注销不起作用。

在站点 a 和站点 b 中,我在下面实现了 FederatedPassiveSignInStatus 控件。

<wif:FederatedPassiveSignInStatus ID="FederatedPassiveSignInStatus1" runat="server" 
    SignOutAction="FederatedPassiveSignOut" OnSignedOut="OnSigOut_click" />

OnSigOut_click:

public void OnSigOut_click(object sender, EventArgs e)
{

    FederatedAuthentication.SessionAuthenticationModule.CookieHandler.Delete();
    FederatedAuthentication.SessionAuthenticationModule.DeleteSessionTokenCookie();
    FederatedAuthentication.SessionAuthenticationModule.SignOut();
    FederatedAuthentication.WSFederationAuthenticationModule.SignOut(false);
    FormsAuthentication.SignOut();
    Session.Abandon();

}

如果我先从站点 A 注销然后刷新站点 B,站点 A 将重定向到 STS 登录登录页面,站点 B 仍然在具有相同登录信息的同一页面中。

谁能知道如何进行单点注销/注销?

4

1 回答 1

0

使用 WSFederationAuthenticationModule。将以下模块添加到 web.config

<modules><add name="WsFederationAuthenticationModule" type="System.IdentityModel.Services.WSFederationAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/></modules>

使用以下方法。以它为例。

WSFederationAuthenticationModule fam = FederatedAuthentication.WSFederationAuthenticationModule;
fam.FederatedSignOut(STSSignOutAbsoluteURL,RPReturnURL); 
于 2013-10-14T18:43:00.313 回答