asp.net – 用于Basic或Windows身份验证的无限重定向循环?
发布时间:2020-05-24 06:19:40 所属栏目:asp.Net 来源:互联网
导读:我正在开发一个新的ASP.NET应用程序.在IIS8上,如果禁用匿名访问并启用基本或 Windows身份验证,则会在浏览器中断循环之后进入无限重定向循环,并放在以下URL: https://XXXXXX.com/Account/Login?ReturnUrl=%2FAccount%2FLogin%3FReturnUrl%3D%252FAccount%252F
|
我正在开发一个新的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 – 如何解决异常“文件不存在”?
- asp.net-mvc – 在ASP.NET MVC6中访问querystrin
- ASP.Net MVC中长时间运行服务器调用的进度条
- asp.net – ObjectCache的“Set”和“Add”有什么
- asp.net-mvc-3 – 名称’ViewBag’在当前上下文中
- asp.net – 从中等信任环境的Web.config读取syst
- asp.net核心 – ASP – 启动时核心迁移EF核心SQL
- ASP.NET Core 1.0 WebSocket安装?
- asp.net-mvc-2 – 我可以从global.asax重定向到控
- ASP.NET MVC 4 EF5与MySQL
热点阅读
