GNOME Bugzilla – Bug 746705
Support OAuth2
Last modified: 2019-01-15 06:16:02 UTC
Geary should support OAuth2 (sometimes referred to as XOAUTH2) for both IMAP and SMTP. This is a requirement for GOA (bug #714876) and UOA (bug #714877) support.
https://github.com/RAOF/geary has some of the work required to support this done. I guess the other person who was interested in it doesn't have any more free time than me, so I'll start (slowly!) hacking at this again.
For reference, this is evolution's implementation of the XOAUTH2 SASL mechanism: https://git.gnome.org/browse/evolution/tree/libemail-engine/camel-sasl-xoauth2.c It works for both GMail and Outlook.com.
*** Bug 751243 has been marked as a duplicate of this bug. ***
I've got a proof of concept branch up on https://github.com/tshikaboom/geary/tree/wip-oauth2. After three days of tedious hacking, it now at least connects, authenticates and fetches emails to/from gmail as a proof of concept :-) Geary just got a whole lot more useful to me! I'll try to clean this up in the next few weeks and see what I can untangle from there. Some notes: - there is home-made, stand-alone oauth2 in there through a webkit1 viewever - the client now depends on json-glib-1.0 and a bit more on libsoup (not just the webkit part now) - searching for messages seems to be a bit flaky? I guess we'll need to refactor some parts of the engine to get off the assumption that authentication can only be done with user/password credentials. etc etc. Lots to do! :)
Also note that for the moment this only stores the access token in the secret service, but we don't have any idea on how long that token is valid (we don't store it at the moment)
*** Bug 775488 has been marked as a duplicate of this bug. ***
*** Bug 784404 has been marked as a duplicate of this bug. ***
*** Bug 795808 has been marked as a duplicate of this bug. ***
Okay, so this is now supported for GOA accounts, and for GMail and Outlook.com this is now the preferred way of adding accounts. As such I'm going to resolve this as fixed. For people not using GOA, OAuth2 support would require implementing a replacement password dialog and some changes to the new accounts editor to not show password rows and hook up the OAuth2 dialog instead. Unfortunately, that is a low priority, and hence an implementation of it would need to come from the community. If you are interested developing an implementation, please jump in and lodge a merge request over at https://gitlab.gnome.org/GNOME/geary