wa=wsignupcleanup1.0 不会在依赖方上注销用户
正在处理我们使用 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 不应该自动处理这个问题吗? 或者这是这样做的方法吗?
Working on project where we use Windows Identity Foundation.
While testing the sign out solution i found that the following call
http://rp/?wa=wsignoutcleanup1.0 does not delete the FedAuth cookie on the RP.
Which in turn make the user stay signed in at the RP.
To remedy the situation I added the following code to the Global.asax:
protected void Application_Start()
{
FederatedAuthentication.WSFederationAuthenticationModule.SigningOut += new EventHandler<SigningOutEventArgs>(WSFederationAuthenticationModule_SigningOut);
}
void WSFederationAuthenticationModule_SigningOut(object sender, SigningOutEventArgs e)
{
FederatedAuthentication.SessionAuthenticationModule.DeleteSessionTokenCookie();
}
But shouldn't WIF take care of this automatically?
Or is this the way to do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
确保所有 url 大小写匹配,甚至 IIS 中的应用程序名称、网站名称大小写也应与配置中的 url 匹配。我很难追踪到这一点。请参阅此处:wasignoutcleanup 问题
Make sure all the url casings match, even the application name, website name casing in IIS should match the urls in configs. I had a hard time tracking this down. See here: wasignoutcleanup issue
同意@Anton。它应该适用于 WIF cookie。但它不会清理您的自己的会话。
如果您还有其他东西需要清理,那么您需要做额外的工作。需要注意的是,会话对象无法从任何 WIF 事件处理程序中获得。因此,例如,您无法从 WSFederationAuthenticationModuleSigningOut 调用 Session.Abandon()。通常,您会重定向到另一个页面进行最终清理。此处提供了一个示例:http://claimsid.codeplex.com(示例#1)
Agree with @Anton. It should work for the WIF cookies. It doesn't cleanup your own session though.
If you have additional stuff to cleanup, then you need to do additional work. The caveat is that the session object is not available from any WIF event handlers. So, for example you can't call Session.Abandon() from WSFederationAuthenticationModuleSigningOut. Typically, you redirect to another page for final cleanup. An example of this is available here: http://claimsid.codeplex.com (sample #1)