无法弄清楚为什么应用程序重定向到登录页面

时间:2023-01-27 14:51:34

I've inherited an ASP.NET application that contains a login screen. When you first start up, or you haven't done anything for a while, it comes up. It turns out we don't need this extra layer of security, and I'm trying to remove it. I thought I removed the code that was doing the redirecting, but it's still going to the login page, even though I've told the app to use default.aspx as the start page, and ensured that default.aspx contains no code that should trigger the redirect (it's using a master page, but the master page also contains nothing that should be redirecting). Where else might it be redirecting to the login page?

我继承了一个包含登录屏幕的ASP.NET应用程序。当你第一次启动时,或者你暂时没有做任何事情时,它会出现。事实证明,我们不需要这个额外的安全层,我正在尝试删除它。我以为我删除了正在进行重定向的代码,但它仍然会进入登录页面,即使我已经告诉应用程序使用default.aspx作为起始页面,并确保default.aspx不包含任何代码触发重定向(它使用母版页,但母版页也不包含应重定向的内容)。还有什么地方可以重定向到登录页面?

3 个解决方案

#1


Look for <authentication> sections (should be under <location> sections) in your web config and delete them

在Web配置中查找 部分(应位于 部分下)并删除它们

#2


Sounds like it could be forms authentication in effect.

听起来它可能是有效的表单身份验证。

In the web.config file change the authentication mode value to none and see if that makes a difference.

在web.config文件中,将身份验证模式值更改为none,并查看是否有所不同。

<authentication mode="none" />

#3


Found the problem. Even though I thought I had all the redirect code removed, there was still some buried in a user control on the default page. Removing that allowed me to bypass the login screen. So, I can't mark any of the responses as the answer, but I gave them all up votes as they were all good answers.

发现了问题。即使我以为我删除了所有重定向代码,但仍然有一些隐藏在默认页面上的用户控件中。删除它允许我绕过登录屏幕。所以,我不能将任何答案标记为答案,但我给了他们所有的选票,因为他们都是好的答案。

#1


Look for <authentication> sections (should be under <location> sections) in your web config and delete them

在Web配置中查找 部分(应位于 部分下)并删除它们

#2


Sounds like it could be forms authentication in effect.

听起来它可能是有效的表单身份验证。

In the web.config file change the authentication mode value to none and see if that makes a difference.

在web.config文件中,将身份验证模式值更改为none,并查看是否有所不同。

<authentication mode="none" />

#3


Found the problem. Even though I thought I had all the redirect code removed, there was still some buried in a user control on the default page. Removing that allowed me to bypass the login screen. So, I can't mark any of the responses as the answer, but I gave them all up votes as they were all good answers.

发现了问题。即使我以为我删除了所有重定向代码,但仍然有一些隐藏在默认页面上的用户控件中。删除它允许我绕过登录屏幕。所以,我不能将任何答案标记为答案,但我给了他们所有的选票,因为他们都是好的答案。