Oauth.io 仅在来自 Facebook v2.4 和 v2.5 的原始数据中获取 "name" 和 "id"

Oauth.io only gets "name" and "id" in the raw data from Facebook v2.4 and v2.5

将Facebook App与oauth.io集成时,我们可以选择的最新API版本是v2.3

虽然登录过程有效,但是,当尝试检索用户数据 (/me) 时,只有元素 nameid 在来自oauth.io 响应:

curl "https://oauth.io/auth/facebook/me" 
     -H  “oauthio:k=<myOauthKey>&access_token=<fbAccessToken>"

我们得到以下响应:

{
    "status": "success",
    "data": 
    {
        "id": "fbId",
        "avatar": "https://graph.facebook.com/v2.3/fbId/picture",
        "name": "User Name",
        "gender": 1,
        "url": "https://www.facebook.com/fbId",
        "raw": 
        {
            "name": "User Name",
            "id": "fbId"
        }
    }
}

如果我们直接使用 Facebook 进行调用,如果我在 URL:

中指定它们,我可以获得额外的字段
curl "https://graph.facebook.com/v2.5/me?access_token=<fbAccessToken>
      &fields=name,email,gender,birthday,first_name,last_name,picture"

我们得到了我们正在寻找的数据:

{
   "name": "User Name",
   "email": "email\u0040email.com",
   "gender": "female",
   "birthday": "03/02/1994",
   "first_name": "User",
   "last_name": "Name",
   "picture": {
      "data": {
         "is_silhouette": false,
         "url": "https://scontent.xx.fbcdn.net/hprofile-xlt1/v/t1.0-1/p50x50/whatever"
      }
   },
   "id": "fbId"
}

原因很明确:因为 v2.4 Facebook 需要 fields 参数来检索额外数据。请参阅https://developers.facebook.com/blog/post/2015/07/08/graph-api-v2.4/

下的更少的默认字段以获得更快的性能

你知道有什么方法可以告诉oauth.io在调用facebook/me调用时填写fields参数吗?

顺便说一句,使用:

https://oauth.io/auth/facebook/me?fields=name,email,gender,birthday

无效。

Oauth.io 已修复该问题,可从 1.0.0-beta.18

获得

https://github.com/oauth-io/oauthd/commit/7beec64ab39955c3afd2eb28ecf7288c74ccdc96