After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 785726 - facebook: Cannot add a new account with Graph API > 2.3
facebook: Cannot add a new account with Graph API > 2.3
Status: RESOLVED FIXED
Product: gnome-online-accounts
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME Online Accounts maintainer(s)
GNOME Online Accounts maintainer(s)
: 785666 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2017-08-02 10:14 UTC by Debarshi Ray
Modified: 2017-08-06 02:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
facebook: Avoid CRITICALs if get_identity_sync can't parse the response (2.13 KB, patch)
2017-08-02 10:28 UTC, Debarshi Ray
none Details | Review
facebook: Avoid CRITICALs if get_identity_sync can't parse the response (2.52 KB, patch)
2017-08-02 19:14 UTC, Debarshi Ray
committed Details | Review
foursquare: Avoid CRITICALs if get_identity_sync can't parse response (3.26 KB, patch)
2017-08-02 19:14 UTC, Debarshi Ray
committed Details | Review
google: Avoid CRITICALs if get_identity_sync can't parse response (1.44 KB, patch)
2017-08-02 19:15 UTC, Debarshi Ray
committed Details | Review
lastfm: Avoid CRITICALs if lastfm_login_sync can't parse response (1.82 KB, patch)
2017-08-02 19:15 UTC, Debarshi Ray
committed Details | Review
oauth2: Avoid CRITICALs if get_tokens_sync can't parse response (1.72 KB, patch)
2017-08-02 19:15 UTC, Debarshi Ray
committed Details | Review
todoist: Avoid CRITICALs if get_identity_sync can't parse response (1.92 KB, patch)
2017-08-02 19:15 UTC, Debarshi Ray
committed Details | Review
live: Avoid CRITICALs if get_identity_sync can't parse response (2.37 KB, patch)
2017-08-02 19:16 UTC, Debarshi Ray
committed Details | Review
flickr: Avoid CRITICALs if get_identity_sync can't parse response (2.92 KB, patch)
2017-08-02 19:16 UTC, Debarshi Ray
committed Details | Review
facebook: Make it work with Graph API > 2.3 (3.44 KB, patch)
2017-08-02 19:17 UTC, Debarshi Ray
none Details | Review
facebook: Update README (847 bytes, patch)
2017-08-02 19:20 UTC, Debarshi Ray
committed Details | Review
facebook: Make it work with Graph API > 2.3 (3.28 KB, patch)
2017-08-02 19:48 UTC, Debarshi Ray
committed Details | Review
lastfm: Avoid CRITICALs if check_cb can't parse response (2.10 KB, patch)
2017-08-03 15:08 UTC, Debarshi Ray
committed Details | Review

Description Debarshi Ray 2017-08-02 10:14:28 UTC
Facebook retired version 2.3 of their Graph API on 8th July [1]. Current versions of the API no longer return a string field named "email" when a GET request is issued against https://graph.facebook.com/me with a valid OAuth2 access token. This breaks get_identity_sync and one cannot add a new Facebook account.

If the Graph API Explorer [2] is pointed at https://graph.facebook.com/v2.10/me?metadata=1, then it sends:
{
  "name": "Debarshi Ray",
  "metadata": {
    "fields": [
      {
        "name": "id",
        "description": "The id of this person's user account. This ID is unique to each app and cannot be used across different apps. [Our upgrade guide provides more information about app-specific IDs](/docs/apps/upgrading/#upgrading_v2_0_user_ids)",
        "type": "numeric string"
      },
      [...]
      {
        "name": "email",
        "description": "The person's primary email address listed on their profile. This field will not be returned if no valid email address is available",
        "type": "string"
      }
    ],
  },
  "id": "...."
}

Now, my account does have a valid email address, and until version 2.3 was retired, it was returning an "email" member for me. A few other people on the Internet have encountered the same, but nobody seems to know why.

[1] https://developers.facebook.com/docs/apps/changelog
[2] https://developers.facebook.com/tools/explorer/
Comment 1 Debarshi Ray 2017-08-02 10:27:19 UTC
Since newer versions of the API no longer include the "username" member [*], I think we should fallback to "name", which is the human-readable name of of the user. However, it can't be used to log in via the embedded web view, so we can no longer pre-fill the form when refreshing the account.

[*] Can't find any references
Comment 2 Debarshi Ray 2017-08-02 10:28:20 UTC
Created attachment 356773 [details] [review]
facebook: Avoid CRITICALs if get_identity_sync can't parse the response
Comment 3 Debarshi Ray 2017-08-02 19:12:36 UTC
(In reply to Debarshi Ray from comment #0)
> Now, my account does have a valid email address, and until version 2.3 was
> retired, it was returning an "email" member for me. A few other people on
> the Internet have encountered the same, but nobody seems to know why.

Ok, I figure this out.

I somehow convinced myself that the "email" scope/permission [1] was one of the default permissions, but it isn't. That's why the Graph API Explorer wasn't showing the "email" because it was not in the list of permissions for the explorer's access token. It started showing up when I changed the explorer to use an access token obtained by gnome-online-accounts.

[1] https://developers.facebook.com/docs/facebook-login/permissions
Comment 4 Debarshi Ray 2017-08-02 19:14:32 UTC
Created attachment 356796 [details] [review]
facebook: Avoid CRITICALs if get_identity_sync can't parse the response
Comment 5 Debarshi Ray 2017-08-02 19:14:45 UTC
Created attachment 356797 [details] [review]
foursquare: Avoid CRITICALs if get_identity_sync can't parse response
Comment 6 Debarshi Ray 2017-08-02 19:15:06 UTC
Created attachment 356798 [details] [review]
google: Avoid CRITICALs if get_identity_sync can't parse response
Comment 7 Debarshi Ray 2017-08-02 19:15:24 UTC
Created attachment 356799 [details] [review]
lastfm: Avoid CRITICALs if lastfm_login_sync can't parse response
Comment 8 Debarshi Ray 2017-08-02 19:15:40 UTC
Created attachment 356800 [details] [review]
oauth2: Avoid CRITICALs if get_tokens_sync can't parse response
Comment 9 Debarshi Ray 2017-08-02 19:15:52 UTC
Created attachment 356801 [details] [review]
todoist: Avoid CRITICALs if get_identity_sync can't parse response
Comment 10 Debarshi Ray 2017-08-02 19:16:07 UTC
Created attachment 356802 [details] [review]
live: Avoid CRITICALs if get_identity_sync can't parse response
Comment 11 Debarshi Ray 2017-08-02 19:16:34 UTC
Created attachment 356803 [details] [review]
flickr: Avoid CRITICALs if get_identity_sync can't parse response
Comment 12 Debarshi Ray 2017-08-02 19:17:01 UTC
Created attachment 356804 [details] [review]
facebook: Make it work with Graph API > 2.3
Comment 13 Debarshi Ray 2017-08-02 19:19:26 UTC
CCing Thomas because the fallback he added in bug 739168 had to be removed (see attachment 356804 [details] [review]). I don't know what the replacement would be, and if one is even possible or desired.
Comment 14 Debarshi Ray 2017-08-02 19:20:55 UTC
Created attachment 356805 [details] [review]
facebook: Update README
Comment 15 Debarshi Ray 2017-08-02 19:48:46 UTC
Created attachment 356808 [details] [review]
facebook: Make it work with Graph API > 2.3
Comment 16 Debarshi Ray 2017-08-03 15:08:42 UTC
Created attachment 356862 [details] [review]
lastfm: Avoid CRITICALs if check_cb can't parse response
Comment 17 Jeremy Bicha 2017-08-06 02:13:10 UTC
*** Bug 785666 has been marked as a duplicate of this bug. ***