Facebook用户访问令牌验证中未返回的电子邮件[重复]

This question already has an answer here:

the front end of my application is doing facebook login. it gets the auth token back and submits it to the server. the server then calls the graph url with the token but all the server gets back is the name and id. i'm manully calling the curl like shown:

curl -v https://graph.facebook.com/me?access_token=...

but the response i get is just name and id.

{"name":"Henry Robers","id":"10155954328696972"}

my application needs an email in order to create an account and send welcome letter and such so i'm stuck. any help is much appreciated.

</div>
  1. Your application must have requested, and the user must have approved, the user_email permission. (Since you posted an active access token, I checked and you do appear to have done that.)

  2. The API responds with a very small subset of fields by default. Adding fields=foo,bar to your call, like so, https://graph.facebook.com/me?fields=id,name,email&access_token=... should get that info (assuming you did #1).

  3. Don't share access tokens publicly, like you did here. I have invalidated it for you, but in many cases these will allow private data to be accessed, as well as posting on the user's behalf. Treat them as critical, private info like passwords.