title: How to get a user's email from an access token using the Facebook Python SDK
body: <p>I am trying to implement Facebook login for an application I am developing.</p>
  
  <p>I am getting an access token like this:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;&lt;/head&gt;
  &lt;body&gt;
    &lt;script&gt;
  window.fbAsyncInit = function() {
      FB.init({
        appId      : '[Redacted]',
        xfbml      : true,
        version    : 'v2.6'
      });
  
      FB.getLoginStatus(function(response) {
      if (response.status === 'connected') {
          window.location = "http://[my domain]/FBloginAuth?"+FB.getAuthResponse()["accessToken"]
      } else {
          window.location = encodeURI("https://www.facebook.com/dialog/oauth?scope=email&amp;client_id=[redacted]&amp;redirect_uri=http://[my domain]/FBloginAuth&amp;response_type=token");
      }
  });
  
    };
  
    (function(d, s, id){
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) {return;}
      js = d.createElement(s); js.id = id;
      js.src = "http://connect.facebook.net/en_US/sdk.js";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));
    &lt;/script&gt;
  
    &lt;div id="status"&gt;&lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My server then fishes the access token from the url like this (Python 2, because I have to support the Google OAuth SDK which doesn't seem to support Python 3.):</p>
  
  <pre><code>graph = facebook.GraphAPI(access_token=environ["QUERY_STRING"]) # Apparently there is an extrea
  profile = graph.get_object('me')
  args = {'fields' : 'id,name,email', }
  profile = graph.get_object('me', **args)
  print(profile)
  </code></pre>
  
  <p>I know that this doesn't parse cases where there are variables in the url. That is not the point. For now I am hand-feeding the token. The code vomits:</p>
  
  <pre><code>{u'id': u'[redacted]', u'name': u'[redacted]'}
  </code></pre>
  
  <p>My question is why the email doesn't appear in the response as I set the scope when asking for the token. Also, what should I do to get the email?</p>