title: Social Login of facebook not working in ASP.Net MVC 5 project
body: <p>I am going through a tutorial to implement facebook social log in my sample web site. Below are the steps I did.</p>
  
  <ol>
  <li>Pointed my localhost application to https and allowed fake SSL in VS.</li>
  <li>Created a web app in facebook developer web site and noted down the secret key and id.</li>
  <li>Added my application localhost URL in the URL section of the dashboard in facebook</li>
  <li>I added key and id in the starup.Auth.cs file in my ASP.Net MVC-5 project . </li>
  </ol>
  
  <p><strong>Behavour:</strong> Now when I run my application from local host (https) and <code>click Register</code> then I see the <code>facebook sign in button</code>. Also when I click that button a facebook pop up comes with <strong>"Sample App" wants to access your facebook data</strong>. So far so good. But as I say <code>YES</code> to it nothing happens after that. I get redirected to the log in page. and the URL is <code>https://localhost:44393/Account/Login#_=_</code></p>
  
  <p><strong>Expected Behaviour:</strong> For the tutorial that I am following after doing above steps one message comes on tutors screen as "Facebook has authenticated.... Enter you email to continue". Something like this. Can some one please guide me here why I am not getting same message and why I am not able to use social log in. I have tried to follow all the steps.</p>
  
  <p><strong>Expected Screenshot from tutorial</strong>
  <a href="https://i.stack.imgur.com/qTvWo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qTvWo.png" alt="enter image description here"></a></p>
  
  <p>Is there any other steps I need to do in facebook developer dashboard?</p>
  
  <p><strong>EDIT 1 :</strong></p>
  
  <p>In the facebook developer dashboard for my app in the Facbook Login Tab->Settings : I see below message.</p>
  
  <p><a href="https://i.stack.imgur.com/QWu4R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QWu4R.png" alt="enter image description here"></a></p>
  
  <p><strong>EDIT 2:</strong> I debugged and found that <strong>returnURL</strong> is <strong>null</strong> when I click on facebook log in button.</p>
  
  <pre><code>   [AllowAnonymous]
          public async Task&lt;ActionResult&gt; ExternalLoginCallback(string returnUrl)
          {
              var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync();
              if (loginInfo == null)
              {
                  return RedirectToAction("Login");
              }
  
              // Sign in the user with this external login provider if the user already has a login
              var result = await SignInManager.ExternalSignInAsync(loginInfo, isPersistent: false);
  </code></pre>