Skip to main content
 首页 » 编程设计

c#之wa=wsignupcleanup1.0 不会在依赖方注销用户

2024年02月23日10shangdawei

在我们使用 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 不应该自动处理这个问题吗? 或者这是这样做的方法吗?

请您参考如下方法:

确保所有 url 大小写匹配,即使是 IIS 中的应用程序名称、网站名称大小写也应与 configs 中的 url 匹配。我很难追踪到这一点。看这里:wasignoutcleanup issue