使用Azure ACS时无法从Active Directory注销
发布时间:2020-12-16 07:40:24 所属栏目:asp.Net 来源:网络整理
导读:我在我的MVC 4应用程序中使用ACS 2.0. 它已配置为登录,它适用于各种提供程序,包括ADFS. 我需要实现注销功能. 由于this question已经过时,我使用了these samples的代码: 这是它的样子: // Load Identity Configuration FederationConfiguration config = Fe
我在我的MVC 4应用程序中使用ACS 2.0.
它已配置为登录,它适用于各种提供程序,包括ADFS. 由于this question已经过时,我使用了these samples的代码: 这是它的样子: // Load Identity Configuration FederationConfiguration config = FederatedAuthentication.FederationConfiguration; // Get wtrealm from WsFederationConfiguation Section string wtrealm = config.WsFederationConfiguration.Realm; string wreply = wtrealm; //return url // Read the ACS Ws-Federation endpoint from web.Config string wsFederationEndpoint = ConfigurationManager.AppSettings["ida:Issuer"]; SignOutRequestMessage signoutRequestMessage = new SignOutRequestMessage(new Uri(wsFederationEndpoint)); signoutRequestMessage.Parameters.Add("wreply",wreply); signoutRequestMessage.Parameters.Add("wtrealm",wtrealm); FederatedAuthentication.SessionAuthenticationModule.SignOut(); var signoutUrl = signoutRequestMessage.WriteQueryString(); 结果,我得到了我应该重定向的注销URL,它将处理令牌并将我发送回去. URL如下所示: https://myacsnamespace.accesscontrol.windows.net/v2/wsfederation?wa=wsignout1.0&wreply=http%3a%2f%2flocalhost%3a61192%2f&wtrealm=http%3a%2f%2flocalhost%3a61192%2f 因此,它可以像Google,Yahoo和Microsoft帐户一样正常运行. 但是,当我使用ADFS提供程序时,它的工作原理如下: >我点击退出并进入可用提供商的页面 当我看到会发生什么时,ACS不会处置它从ADFS获得的安全令牌,并重新使用它. 您是否有任何关于如何强制ACS处理此令牌的线索? 提前致谢! 解决方法
1 for @ oren-melzer的答案:浏览器缓存http基本凭据并自动重新发送它们.移动到表单auth(使用cookie)或注销,特别是拒绝浏览器的auth标头,不断返回401.有时这个“返回401有效凭据”用于清除浏览器,有时您只需要用户关闭浏览器.
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- Asp.net,在哪里存储登录用户的用户名?
- asp.net – 在页面刷新时再次触发GridView_RowCommand事件
- asp.net-mvc – 如何删除SimpleMembership用户?
- asp.net – 将GridView导出到多个Excel工作表
- asp.net – NuGet不断崩溃Visual Studio 2013
- asp.net-mvc-4 – 如何让{controller} / {id} / {action}在
- asp.net-mvc-3 – 如何在asp.net mvc3中将Id从父视图传递到
- arrays – ASP经典中的数组合并
- asp.net – 如何预编译Web应用程序项目?
- ASP.NET MVC 5表单验证和错误处理
推荐文章
站长推荐
- asp.net – jquery下拉选择器AutoPostback
- asp.net – 无效的安全证书和域名
- ASP.NET Core中间件实现分布式 Session
- asp.net-mvc – HiddenFor(x => x.Id)正在由UrlP
- 如何清除Asp.Net按钮上所有文本框的值单击
- asp.net – 了解runat服务器属性
- .net – log4net – FileAppender在文件开头写入
- asp.net-web-api – 我的Owin控制台项目从哪里知
- asp.net-mvc – Asp.Net自定义路由和自定义路由并
- asp.net-mvc-4 – MVC4/DotNetOpenAuth中的自定义
热点阅读