windows – 使用自定义STS从访问控制服务注销
发布时间:2020-12-14 05:54:19 所属栏目:Windows 来源:网络整理
导读:我正在使用带有自定义STS的 Windows Azure访问控制服务.我可以通过ACS登录我的应用程序,但是我在登出功能方面遇到了麻烦.我在我的应用程序中尝试过这段代码. WSFederationAuthenticationModule fam = FederatedAuthentication.WSFederationAuthenticationMod
我正在使用带有自定义STS的
Windows Azure访问控制服务.我可以通过ACS登录我的应用程序,但是我在登出功能方面遇到了麻烦.我在我的应用程序中尝试过这段代码.
WSFederationAuthenticationModule fam = FederatedAuthentication.WSFederationAuthenticationModule; try { FormsAuthentication.SignOut(); } finally { fam.SignOut(true); } Page.Response.Redirect("default.aspx"); 但似乎它从ACS注销用户而不是从自定义STS注销.从STS注销我该怎么办?应用(RP),ACS或STS中的问题可能出在哪里? 我认为ACS应该要求自定义STS注销用户,但似乎它没有这样做.我错过了什么? 解决方法
我已经为FederatedSignout创建了一个帮助方法,在代码中注释了我在路上发现的内容(hth)
public static void FederatedSignOut(string reply = null) { WSFederationAuthenticationModule fam = FederatedAuthentication.WSFederationAuthenticationModule; // Native FederatedSignOut doesn't seem to have a way for finding/registering realm for singout,get it from the FAM string wrealm = string.Format("wtrealm={0}",fam.Realm); // Create basic url for signout (wreply is set by native FederatedSignOut) string signOutUrl = WSFederationAuthenticationModule.GetFederationPassiveSignOutUrl(fam.Issuer,null,wrealm); // Check where to return,if not set ACS will use Reply address configured for the RP string wreply = !string.IsNullOrEmpty(reply) ? reply : (!string.IsNullOrEmpty(fam.Reply) ? fam.Reply : null); WSFederationAuthenticationModule.FederatedSignOut(new Uri(signOutUrl),!string.IsNullOrEmpty(wreply) ? new Uri(wreply) : null); // Remarks! Native FederatedSignout has an option for setting signOutUrl to null,even if the documentation tells otherwise. // If set to null the method will search for signoutUrl in Session token,but I couldn't find any information about how to set this. Found some Sharepoint code that use this // Michele Leroux Bustamante had a code example (from 2010) that also uses this form. // Other examples creates the signout url manually and calls redirect. // FAM has support for wsignoutcleanup1.0 right out of the box,there is no need for code to handle this. // That makes it even harder to understand why there are no complete FederatedSignOut method in FAM // When using native FederatedSignOut() no events for signout will be called,if you need this use the FAM SignOut methods instead. } 此代码用于我们为带有ACS的Web SSO创建的标准RP库中. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 是否可以在Windows批处理或Java中编写Tee?
- Windows NTP服务器A Stratum为2,Windows NTP Server B Stra
- xaml – 如何在Win10 Universal应用程序中禁用GridView / L
- windows-server-2008 – 如何在IIS 7.5中启用TLS 1.1,1.2
- windows-server-2003 – 使用Windows 2003 R2从命令行发送电
- 计算机专业名词解释
- windows-server-2008 – 验证文件是否可以从7Zip存档成功解
- windows – 调试可怕的’应用程序无法初始化’错误
- windows-server-2008 – 即使添加了防火墙例外,Windows 200
- windows – 禁用USB存储设备
推荐文章
站长推荐
- 如何在Windows Server 2016上安装用于托管服务器
- Windows10 & Python3 部署Robot FrameWork自
- windows – 如何重写历史记录以删除git中的可执行
- winapi – 如何使用win32 API创建带有VC的椭圆形
- win-universal-app – 无法访问Windows Universa
- .net – UISpy.exe和Inspect.exe有什么区别? (来
- 确定哪些对象文件导致.dll大小增加[C]
- windows – 与WMF 4.0有任何已知的不兼容性吗?
- active-directory – 当删除AD用户帐户时,Window
- .net – 为什么System.Environment.MachineName值
热点阅读