在我们使用 Windows Identity Foundation 的项目上工作。在测试注销解决方案时,我发现以下调用 http://rp/?wa=wsignoutcleanup1.0不会删除 RP 上的 FedAuth cookie。这反过来又使用户在 RP 上保持登录状态。
为了纠正这种情况,我在 Global.asax 中添加了以下代码:
protected void Application_Start()
{
FederatedAuthentication.WSFederationAuthenticationModule.SigningOut += new EventHandler<SigningOutEventArgs>(WSFederationAuthenticationModule_SigningOut);
}
void WSFederationAuthenticationModule_SigningOut(object sender, SigningOutEventArgs e)
{
FederatedAuthentication.SessionAuthenticationModule.DeleteSessionTokenCookie();
}
但是WIF不应该自动处理这个吗?或者这是这样做的方法?