title: Handle denied email permission in Facebook
body: <p>I am trying to build Login with Facebook API manually. I am using <a href="https://www.nuget.org/packages/Facebook/" rel="nofollow noreferrer" title="Facebook API">https://www.nuget.org/packages/Facebook/</a> &amp; using following code in my ASP.NET MVC.</p>
  
  <p>Basic idea is to ask users permission, access the users email, auto-register to my system.</p>
  
  <p>Problem is when user un-check access to email &amp; click on Ok on the facebook authentication popup. Next time when user clicks on "Login with Facebook" button, facebook authentication pop-up won't appear, as user has already allowed the access, and I don't get users email. The only way, facebook authentication box re-appear, is user revoke access to my app from his personal facebook account.</p>
  
  <p>Is there another way, I can get the facebook authentication popup again? Or better way to do this?</p>
  
  <pre><code>var fb = new FacebookClient();
  dynamic result = fb.Post("oauth/access_token", new
  {
      client_id = System.Configuration.ConfigurationManager.AppSettings["FacebookAppId"],
      client_secret = System.Configuration.ConfigurationManager.AppSettings["FacebookAppSecret"],
      redirect_uri = System.Configuration.ConfigurationManager.AppSettings["FacebookRedirectURL"],
      code = code
  });
  
  var accessToken = result.access_token;
  
  // Store the access token in the session
  Session["AccessToken"] = accessToken;
  
  // update the facebook client with the access token so
  // we can make requests on behalf of the user
  fb.AccessToken = accessToken;
  
  // Get the user's information
  dynamic me = fb.Get("me?fields=first_name,last_name,id,email");
  if (!String.IsNullOrWhiteSpace(me.email))
  {
      string email = me.email;
      // Register Or login user
  }
  else
  {
      // Handle declined email permissions
  }
  </code></pre>