2014-09-10 33 views
3

更新我MVC5应用程序的nuget包(到目前为止一直工作正常)用于验证用户的Facebook身份验证管理器现在总是返回null。在更新nuget后,AuthenticationManager.GetExternalLoginInfoAsync()返回null

我正在Visual Studio 2012中开发我的解决方案并使用最新的webtools。

[AllowAnonymous] 
public async Task<ActionResult> ExternalLoginCallback(string returnUrl) 
{ 
    var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync(); 
    if (loginInfo == null) 
    { 
     return RedirectToAction("Login"); 
    } 
} 

围绕谷歌搜索后,我发现Facebook的API已经改变,但没有关于如何得到的NuGet pacakages与MVC5应用工作的解决方案。请任何人都可以指导我如何让这个工作再次。

我试过以下,但从Facebook返回的请求始终为空。

添加

<system.web><authentication mode="None" /></system.web> 
<system.webServer><modules><remove name="FormsAuthentication" /></modules></system.webServer> 

设置

HttpContext.GetOwinContext().Response.Cookies.Append("OwinCookie", "SomeValue"); 
HttpContext.Response.Cookies["ASPCookie"].Value = "SomeValue"; 
HttpContext.Response.Cookies.Remove("ASPCookie"); 

回答

1

确定。所以我找到了答案。

我做了如下得到它的工作

登录到开发人员门户网站,找到你的应用程序,并做到以下几点。

应用详细信息>以应用为中心的列出平台>选择是的网站

相关问题