I installed the VS2013 final bits that were released yesterday, and I'm trying to get an example working where I enable an external Facebook login. My first question:
In this controller code (which I did not touch and left as is from the sample template):
//
// GET: /Account/ExternalLoginCallback
[AllowAnonymous]
public async Task<ActionResult> ExternalLoginCallback(string returnUrl)
{
var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync();
if (loginInfo == null)
{
return RedirectToAction("Login");
}
I set a breakpoint on the line await AuthenticationManager.GetExternalLoginInfoAsync(). The code returns (after I do my Facebook login), and "loginInfo" is null. In the UI, the login page continues to be displayed, with no change. How can I debug this? I was trying to find the code inside of GetExternalLoginInfoAsync() but according to this thread:
Where is Microsoft.AspNet.Identity.Owin.AuthenticationManager in Asp.Net Identity RTM version?
AuthenticationManager is now gone. (This does not seem to be the case per above.)
My second question: Is anyone else able to get the sample working with Facebook login with no changes to the ASP.NET MVC5 sample code (other than uncommenting app.UseFacebookAuthentication and filling in your FB app details)? (You'll have to configure an alias host with Facebook, such as "localtest.me" and configure it with IIS express.)
Thanks for any help...
-Ben
i added microsoft.security.owin.facebook reference to project fron NuGet package manager and it started working fine.
I could see everything working in Fiddler with the info required to populate the loginInfo present but was still getting null returned from GetExternalLoginInfoAsnyc.
When I added the following line to the ConfigureAuth method in Startup.Auth, loginInfo was no longer null.