简体   繁体   English

表单身份验证无限循环

[英]Forms authentication infinite loop

I have an application that works great on localhost with forms authentication. 我有一个可以在本地主机上使用表单身份验证的应用程序。

I deployed it to the deployment machine and it to the build machine and received and endless set of 302 redirects. 我将其部署到部署计算机上,并将其部署到构建计算机上,并收到了无数的302重定向集。

I try logging onto the deployment machine and access the page via the deployment machines ip and it works again. 我尝试登录到部署机器并通过部署机器ip访问页面,该页面可以再次使用。

So it is not working when I try and access the site from my computer to the build computer. 因此,当我尝试从计算机到构建计算机访问该站点时,它不起作用。

What could be causing this? 可能是什么导致了这个?

I had this problem a few weeks ago. 几周前我遇到了这个问题。 My problem was that my Default.aspx required roles/permissions that the user I was trying to log with did not have. 我的问题是Default.aspx要求我尝试登录的用户所没有的角色/权限。

Default.aspx (anonymous user) -> Login.aspx -> [logged in] -> Default.aspx (user denied access) -> automatic redirect to the main page -> Default.aspx (user denied) -> endless loop.

I fixed it by removing any permissions required for my default page and making sure the permissions in my web.config were Ok. 我通过删除默认页面所需的所有权限并确保我的web.config中的权限确定,来解决此问题。

There's most likely an IIS configuration issue. 最有可能是IIS配置问题。

  • Determine that your Authentication is set to allow anonymous. 确定您的身份验证设置为允许匿名。
  • Ensure your default page is specified in the list in IIS. 确保在IIS的列表中指定了默认页面。

And it was because the time on the server was different then the time on my client machine. 这是因为服务器上的时间与客户端计算机上的时间不同。 Who knew such a thing could happen? 谁知道这样的事情会发生? Not me. 不是我。

The sad part is I changed the time hours ago but I put it at AM instead of PM. 可悲的是,我几小时前更改了时间,但我将其设置为上午而不是下午。 Awesome! 真棒!

I resolved this issue on a Windows XP machine with IIS 5.1 for a .NET 1.1 site by changing the ASP.NET version correctly to 1.1.4322 instead of 2.0.50727 (what it was set to). 我通过将ASP.NET版本正确更改为1.1.4322而不是2.0.50727(已设置为),在带有IIS 5.1的Windows XP计算机上为.NET 1.1站点解决了此问题。

Just wanted to mention that in case it helps someone else. 只是想提一下,以防它对别人有帮助。 I feel silly for not realising that sooner. 我没有早点意识到这一点很傻。 :-) :-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM