Discussion:
Mbsync, XOAUTH2, and Gmail
ben lamothe
2017-03-05 15:13:00 UTC
Permalink
Hi. I'm trying to sync my gmail account locally with mbsync. Gmail recently
rolled out an XOAUTH2 based authentication scheme, and they've required it
by default. I have been having trouble configuring mbsync to connect to
gmail with oauth.

I've noticed from the mbsync man page that mbsync has sasl support, and I
also understand that XOAUTH2 is a valid sasl auth mechanism, but I am
unclear how to configure mbsync to make use of that mechanism through sasl.
I can't find any documentation or guides about how to set this up with
mbsync specifically.

I understand that I can enable the "less secure apps" setting in gmail, but
I would rather not do that if it's at all possible because using revokeable
oauth tokens is more secure than using the raw passwords.

How do I configure mbsync to connect to gmail using oauth tokens instead of
a password?
Oswald Buddenhagen
2017-03-05 17:26:01 UTC
Permalink
Post by ben lamothe
I've noticed from the mbsync man page that mbsync has sasl support, and I
also understand that XOAUTH2 is a valid sasl auth mechanism, but I am
unclear how to configure mbsync to make use of that mechanism through sasl.
I can't find any documentation or guides about how to set this up with
mbsync specifically.
AuthMech XOAUTH2

there are at least two plugins availbable:
https://github.com/sweetums/SASL-OAuth
https://github.com/robn/sasl2-oauth

however, i never tried myself, and it may very well not work.
Oswald Buddenhagen
2017-04-08 13:33:34 UTC
Permalink
Post by Oswald Buddenhagen
Post by ben lamothe
I've noticed from the mbsync man page that mbsync has sasl support, and I
also understand that XOAUTH2 is a valid sasl auth mechanism, but I am
unclear how to configure mbsync to make use of that mechanism through sasl.
I can't find any documentation or guides about how to set this up with
mbsync specifically.
AuthMech XOAUTH2
https://github.com/sweetums/SASL-OAuth
https://github.com/robn/sasl2-oauth
however, i never tried myself, and it may very well not work.
i looked into this somewhat. while i see no fundamental reason why it
would not work, xoauth is a really bad match for a command line
application. the manual work involved in setting it up is prohibitive,
and i see no reason why anyone would do that.

Loading...