当我对子应用程序执行 HTTP POST 时,为什么在主站点上不断受到身份验证质询?

发布于 2024-10-09 18:46:07 字数 827 浏览 3 评论 0原文

我希望有人可以通过解决这个问题来帮助指出我的无知... :)

我刚刚在 http 上安装了一个新的 DNN 站点://www.digitalrefraction.com,一切工作正常。 我还有一个不相关的 ASP.Net MVC 2.0(具有无扩展 URL - 就其价值而言)应用程序在该域的子文件夹中运行,位于以下 URL 中: http://www.digitalrefraction.com/refractor

我可以对我的子应用程序执行 HTTP GET 请求。然而,当我执行 POST 时,我会看到一个“需要身份验证”对话框,其中显示:“输入 http 的用户名和密码: //www.digitalrefraction.com”。

现在我很困惑。为什么对主域的 POSTS 和 GETS 工作正常,但当我对子应用程序执行 POST 时,我会受到主域身份验证的质疑?但是子应用程序的 GET 有效!

是的,我检查了 DNN 主站点的 web.config,并没有发现任何授权条目。我尝试添加一些以允许匿名访问 /refractor,但这没有什么区别。 还检查了我的子应用程序 web.config。 我有些不知所措。

请注意,我说的是子应用程序(子文件夹),而不是子域。

任何提示或想法,或直接的答案,将不胜感激。 :)

谢谢。

I hope somebody can assist in pointing out my ignorance by solving this problem... :)

I have just installed a new DNN site on http://www.digitalrefraction.com, and all is working fine there.
I also have an unrelated ASP.Net MVC 2.0 (with extensionless URLs - for what that is worth) application running in a subfolder on that domain, in the following URL:
http://www.digitalrefraction.com/refractor

I can do HTTP GET requests just fine to my sub application. However, the moment I do a POST I get an "Authentication Required" dialog box that says: "Enter a username and password for http://www.digitalrefraction.com".

Now I am confused. Why do POSTS and GETS to the main domain work fine, but then when I do a POST to the sub application, I get challenged for the main domain's authentication? But GETs to the sub application works!

Yes, I have checked the main DNN site's web.config, and have found no authorization entries at all. I tried adding some to allow anonymous access to /refractor, but that made no difference.
Also checked my sub applications web.config.
I am somewhat at a loss.

Note, I am talking about a sub application (sub folder), not a sub domain.

Any tips or ideas, or straight answers, will be greatly appreciated. :)

Thanx.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你是年少的欢喜 2024-10-16 18:46:07

好的,感谢 Cyber​​nate,我重新审视了整个事情。
本质上,我的子应用程序的登录不起作用,因此,处理 HTTP POST 且需要安全性的控制器导致了身份验证挑战。

登录不起作用的原因是整个嵌套应用程序设置和继承自根 DNN 站点的 web.config。

具体问题;该应用程序由于从根 web.config 继承的某些设置而引发错误,因此我在某些部分的顶部插入了 ,例如 httpmodules

最后,我为每个 DNN httpmodules,而不是 > 在 DNN web.config 中配置。通过这种方式,我摆脱了我不想要/不需要的东西,但仍然保留了我的应用程序工作所需的模块。

这是一个严重的痛苦,但很高兴现在已经结束了!建议:远离嵌套的 ASP.Net 应用程序,除非您确实需要它们。

想想看,是否有一个设置(应用程序范围的全局)意味着“不要从任何父应用程序/web.config 继承任何设置”?那将会非常有帮助!

Ok, thanx to Cybernate, I re looked at the whole thing.
Essentially the login of my sub-app did not work, and as a result, the controller that handled the HTTP POST, and that required security, resulted in the challenge for authentication.

The reason that the login was not working was because of the whole nested application setup and inheriting from the root DNN site's web.config.

The specific problem; the app was throwing errors because of some settings it was inheriting from the root web.config, so I inserted a <clear /> at the top of some sections such as httpmodules to get rid of the inherited DNN modules. Turns out, there are some modules loaded by default that aren't the ones specified in the DNN's web.config. Some of them having to do with authentication. So clearring them basically broke my login.

In the end, instead of <clear /> I added a <remove ... /> for each of the DNN httpmodules that were configured in the DNN web.config. In this way I got rid of the stuff I didn't want / need, but still retained the modules that were needed for my app to work.

It was a serious pain, but glad it's over now! Advice: stay away from nested ASP.Net applications, unless you really need them.

Come to think of it, isn't there a setting (global to application scope) that means "DO NOT INHERIT ANY SETTING FROM ANY PARENT APPLICATION / web.config"? That would have been extremely helpful!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文