asp.net – 用于Basic或Windows身份验证的无限重定向循环?
发布时间:2020-12-15 22:48:18 所属栏目:asp.Net 来源:网络整理
导读:我正在开发一个新的ASP.NET应用程序.在IIS8上,如果禁用匿名访问并启用基本或 Windows身份验证,则会在浏览器中断循环之后进入无限重定向循环,并放在以下URL: https://XXXXXX.com/Account/Login?ReturnUrl=%2FAccount%2FLogin%3FReturnUrl%3D%252FAccount%252
我正在开发一个新的ASP.NET应用程序.在IIS8上,如果禁用匿名访问并启用基本或
Windows身份验证,则会在浏览器中断循环之后进入无限重定向循环,并放在以下URL:
https://XXXXXX.com/Account/Login?ReturnUrl=%2FAccount%2FLogin%3FReturnUrl%3D%252FAccount%252FLogin%253FReturnUrl%253D%25252FAccount%25252FLogin%25253FReturnUrl%25253D%2525252FAccount%2525252FLogin%2525253FReturnUrl%2525253D%252525252FAccount%252525252FLogin%252525253FReturnUrl%252525253D%25252525252FAccount%25252525252FLogin%25252525253FReturnUrl%25252525253D%2525252525252FAccount%2525252525252FLogin%2525252525253FReturnUrl%2525252525253D%252525252525252FAccount%252525252525252FLogin%252525252525253FReturnUrl%252525252525253D%25252525252525252FAccount%25252525252525252FLogin%25252525252525253FReturnUrl%25252525252525253D%2525252525252525252FAccount%2525252525252525252FLogin%2525252525252525253FReturnUrl%2525252525252525253D%252525252525252525252FAccount%252525252525252525252FLogin%252525252525252525253FReturnUrl%252525252525252525253D%25252525252525252525252FAccount%25252525252525252525252FLogin%25252525252525252525253FReturnUrl%25252525252525252525253D%2525252525252525252525252FAccount%2525252525252525252525252FLogin%2525252525252525252525253FReturnUrl%2525252525252525252525253D%252525252525252525252525252FAccount%252525252525252525252525252FLogin%252525252525252525252525253FReturnUrl%252525252525252525252525253D%25252525252525252525252525252FAccount%25252525252525252525252525252FLogin%25252525252525252525252525253FReturnUrl%25252525252525252525252525253D%2525252525252525252525252525252FAccount%2525252525252525252525252525252FLogin%2525252525252525252525252525253FReturnUrl%2525252525252525252525252525253D%252525252525252525252525252525252FAccount%252525252525252525252525252525252FLogin%252525252525252525252525252525253FReturnUrl%252525252525252525252525252525253D%25252525252525252525252525252525252FAccount%25252525252525252525252525252525252FLogin%25252525252525252525252525252525253FReturnUrl%25252525252525252525252525252525253D%2525252525252525252525252525252525252FAccount%2525252525252525252525252525252525252FLogin%2525252525252525252525252525252525253FReturnUrl%2525252525252525252525252525252525253D%252525252525252525252525252525252525252F 凭据框永远不会弹出.可能是错的? 解决方法
我修好了它.首先要做的是启用Windows认证,并在IIS和Visual Studio项目上禁用匿名(在解决方案资源管理器中选择根项目节点,并在属性窗口中禁用匿名访问并启用Windows认证).接下来,将以下行添加到您的web.config中:
<system.webServer> <modules> <remove name="FormsAuthenticationModule" /> <remove name="FormsAuthentication" /> </modules> </system.webServer> 接下来打开App_Start / Startup.Auth.cs并注释掉(或删除)以下内容: // Enable the application to use a cookie to store information for the signed in user app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,LoginPath = new PathString("/Account/Login") }); // Use a cookie to temporarily store information about a user logging in with a third party login provider app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie); 接下来,发布到您的网络服务器,您应该能够登录没有重定向错误! (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net mvc errorhandler没有显示自定义错误页面
- asp.net-mvc – 如何只允许mvc4 razor中的文本框中的数字
- ASP.Net MVC3 Razor Href错误
- 如何在调用WCF服务之前弹出一个确认对话框?
- asp.net – Application_Error – GetLastError()或GetLast
- asp.net – 奇怪的Ajax ComboBox下拉列表
- asp.net – 在非生产环境中复制与负载相关的崩溃
- 在asp.net mvc中如何使用usercontrols来显示“岛”数据?
- asp.net-mvc – 为什么Request.IsAuthenticated是错误的
- asp.net – 有没有办法使用System.Net.Mail.SendAsync()捕获
推荐文章
站长推荐
热点阅读