使用 CNAME 重定向登录到 Azure 部署的 Web 应用程序时出现问题
我在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在这里很难确定您的确切问题。您可以查看 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.