使用 CNAME 重定向登录到 Azure 部署的 Web 应用程序时出现问题

发布于 2024-08-16 12:35:01 字数 586 浏览 1 评论 0原文

我在使用 CNAME 将我的域重定向到 Azure 应用程序的 URL 在 Azure 上运行时,使用表单身份验证登录 ASP.NET MVC 网站时遇到了问题。为了清楚地说明我的设置方式,以下博客文章解释了我的设置方式。 http://blog.smarx.com/posts/custom- :

问题 当我输入我的凭据并单击登录表单上的“提交”时,代码中的登录成功执行并重定向到主页,但是,浏览器似乎认为它没有登录。我可以看出这一点,因为登录的用户只能选择注销,但我看到了登录链接。所以也许这是我的代码对吗?也许吧,我希望如此,但我注意到,只有当我尝试从我的域“www.MyDomain.com”登录时,才会出现问题。如果我使用 Azure url mydomain.cloudapp.net,则登录工作正常。另一个有趣的部分是,如果我从 mydomain.cloudapp.net 登录,然后导航到 www.MyDomain.com,我会看到我已登录并且一切正常。

请帮忙。

非常感谢, 汤姆

I am running into an issue with logging into an ASP.NET MVC web site using Forms Authentication while running on Azure using a CNAME to redirect my domain to the url of the Azure application. For clarity on how I am setup the following blog post explains how I am setup. http://blog.smarx.com/posts/custom-domain-names-in-windows-azure

The problem:
When I enter my credentials and click submit on the login form, the login in the code successfully executes and redirects to the Home page however, it appears that the browser does not think it is logged in. I can tell this because a logged in user will only have the option to log out, but I am seeing the login link. So maybe it is my code right? Well maybe, and I hope it is but what I have noticed is that the problem only occurs if I am trying to login from my domain "www.MyDomain.com". If I use the Azure url mydomain.cloudapp.net, then the login in works fine. The other interesting part is if I login from mydomain.cloudapp.net and then navigate to www.MyDomain.com I see that I am logged in and everything works properly.

Please help.

Thank you very much,
Tom

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

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

发布评论

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

评论(1

森林迷了鹿 2024-08-23 12:35:01

在这里很难确定您的确切问题。您可以查看 Lokad.Translate:它是一个简单的开源 ASP。 NET MVC 应用程序专为 Azure 设计。它与表单身份验证配合使用,并且我们的实现在 CNAME 重定向方面似乎运行良好。您可以尝试根据自己的需要重现我们的设置。

It's hard to pinpoint your exact problem here. You can have a look at Lokad.Translate: it's a simple open source ASP.NET MVC app designed for Azure. It works with Forms authentication, and our implementation appears to be running fine with the CNAME redirects. You could try to reproduce our setup for your own needs.

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