Facebook OAuth LoginInfo is null on callback

I am creating a test app and testing externallogins via facebook.

I am using fiddler and when I click the facebook login button I get 200 code results (but they are blocked due to HTTPS) but I get a null value for loginInfo.

Here specifically:

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

      

I have reset my private key and it doesn't work. I have the most updated version of Microsoft.AspNet.Identity.Owin (2.2.1).

What's connected with this?

Any help is appreciated.

+3


source to share


1 answer


Assuming you've created a new Facebook app, it will work on the latest Facebook Api. The default templates no longer work out of the box, due to Facebook changing the Api. They reduced the number of fields returned by default and now you need to define additional fields.

Take a look at the following post which has two possible workarounds for this.



Why does the new fb api 2.4 return a null email address on MVC 5 with id and oauth 2?

+1


source







All Articles