使用https访问时,MVC 4 OAuth失败 [英] MVC 4 OAuth fails when accesing with https
问题描述
我在我的网站上实现了oauth登录,只要我使用http进入我的网站就可以正常生产,但不能使用https。
特此在ExternalLoginCallback方法上失败,在这一行
AuthenticationResult result = OAuthWebSecurity.VerifyAuthentication(Url.Action(" ExternalLoginCallback",new {ReturnUrl = returnUrl}));
我不是sur这是一个MVC特定的问题。身份验证工作与否之间的唯一区别是http / https协议。
我不知道这是否很重要,但该应用程序托管在Azure上的虚拟机上的IIS8,Windows Server 2012R2上。
听起来你实际上并没有在你的代码中使用Live Connect,这是本论坛的主题。您可能想尝试在ASP.NET MVC论坛上发布问题:
I implemented oauth login with facebook on my site and it works as normal on production as long as I enter my site using http, but not with https.
It's failing specifically on the ExternalLoginCallback method, on the this line
AuthenticationResult result = OAuthWebSecurity.VerifyAuthentication(Url.Action("ExternalLoginCallback", new { ReturnUrl = returnUrl }));
I'm not sure it's an MVC specific problem though. The only difference between the authentication working or not is the http/https protocol.
I don't know if this is important, but the app is hosted on IIS8, Windows Server 2012R2 on a virtual machine on Azure.
It sounds like you're not actually using Live Connect in your code, which is the subject matter of this forum. You might want to try posting a question on the ASP.NET MVC forum:
这篇关于使用https访问时,MVC 4 OAuth失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!