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 661065 - Implement OAUTH2 for google accounts
Implement OAUTH2 for google accounts
Status: RESOLVED FIXED
Product: gnome-online-accounts
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME Online Accounts maintainer(s)
GNOME Online Accounts maintainer(s)
Depends on:
Blocks: 652546 685289 685297 685299
 
 
Reported: 2011-10-06 09:49 UTC by Xavier Claessens
Modified: 2012-10-24 15:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
google: Implement OAuth 2.0 (15.89 KB, patch)
2012-09-23 21:05 UTC, Debarshi Ray
committed Details | Review

Description Xavier Claessens 2011-10-06 09:49:50 UTC
telepathy-gabble needs an oauth2 access-token to log in google XMPP. But the GoaObject does not implement the GoaOAuth2Based iface.
Comment 1 David Zeuthen (not reading bugmail) 2011-10-06 15:31:08 UTC
Well, we can't both offer OAuth1 and OAuth2 tokens at the same time - at least not while there is no way to get an OAuth1 token from an OAuth2 one or vice-versa. Well, we *could*, but that would include making the user authenticate *twice* (once for the OAuth1 token and once for the OAuth2 token) and we don't want that.

So we will have to have a flag day where everything in GNOME use GOA switches to OAuth2. This is, however, not yet possible because some Google services, such as IMAP, only supports OAuth1 right now. Maybe GNOME 3.4 or GNOME 3.6, I don't know.

As I said in bug 659435 comment 2, we (e.g. the GNOME foundation) probably needs to establish a relationship with Google so they are aware of our needs. Maybe that would help. I don't know.

For now I'm closing this bug WONTFIX in lieu of a CANTFIX resolution.
Comment 2 Guillaume Desmottes 2011-10-08 20:18:18 UTC
Maybe in the meantime an option could be to re-use the login/password entered by the user when authentificating for OAuth1 and re-use them to authentificate using OAuth2. That would be a dirty hack, for sure, but that's the best we can do until Google unify the accesses to its services (and it can take a while...).
Comment 3 David Zeuthen (not reading bugmail) 2011-10-10 15:51:53 UTC
(In reply to comment #2)
> Maybe in the meantime an option could be to re-use the login/password entered
> by the user when authentificating for OAuth1 and re-use them to authentificate
> using OAuth2. That would be a dirty hack, for sure, but that's the best we can
> do until Google unify the accesses to its services (and it can take a
> while...).

GOA is completely ignorant on how the provider authenticates the user (for better or worse) so this would require snooping on the embedded Webkit-gtk widget.. and in fact, it could be that authentication does not even require a password.. or, in my case, requires two-factor authentication (a password and a mobile device) [1]...


[1] : http://googleblog.blogspot.com/2011/02/advanced-sign-in-security-for-your.html
Comment 4 Cosimo Cecchi 2012-03-24 00:26:30 UTC
(In reply to comment #1)
> Well, we can't both offer OAuth1 and OAuth2 tokens at the same time - at least
> not while there is no way to get an OAuth1 token from an OAuth2 one or
> vice-versa. Well, we *could*, but that would include making the user
> authenticate *twice* (once for the OAuth1 token and once for the OAuth2 token)
> and we don't want that.

Since we already make the user authenticate twice (see bug 652546) I think it's still better to do that in a single step (i.e. from the Online Accounts panel) than once there and once in Empathy, as a stop-gap solution until we can support OAuth2 for everything. Jon, what do you think?
Comment 5 Debarshi Ray 2012-09-11 13:44:46 UTC
Reopening, because GMail supports OAuth 2.0 for IMAP and SMTP since April 20, 2012:
https://developers.google.com/google-apps/gmail/oauth_protocol
Comment 6 Debarshi Ray 2012-09-15 07:57:45 UTC
This has now been implemented in the wip/oauth2 branch:
http://git.gnome.org/browse/gnome-online-accounts/log/?h=wip/oauth2
Comment 7 Debarshi Ray 2012-09-23 21:05:06 UTC
Created attachment 225037 [details] [review]
google: Implement OAuth 2.0

    As of April 20, 2012 [1] GMail finally implements the SASL XOAUTH2
    mechanism. With that Google now supports OAuth 2.0 for all the
    different services that we care about.
    
    Unlike their OAuth 1.0 implementation, they don't support "anonymous"
    keys with OAuth 2.0. We need to register for a client_id /
    client_secret pair. However, we are allowed to embed the client_secret
    in our source code:
    https://developers.google.com/accounts/docs/OAuth2InstalledApp#overview
    
    With this we can leverage services like GTalk and Google Drive that
    did not support OAuth 1.0. For starters, the scope for GTalk has been
    added so that Empathy can use it.
    
    [1] https://developers.google.com/google-apps/gmail/oauth_protocol
        The documentation was updated retroactively because it did not
        mention anything about OAuth 2.0 weeks after the mentioned date.
        Yay Google!
Comment 8 Debarshi Ray 2012-09-23 21:06:57 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.