From b0eaf5191c9bc5b128e347625b7eef998ba63c41 Mon Sep 17 00:00:00 2001 From: Frode Aannevik Date: Wed, 10 Jul 2019 21:00:28 +0200 Subject: Support imaps with oauthbearer authentication (Gmail) imaps+oauthbearer://user:token@host?token_endpoint=... - the config Source password is used as access token if no token_endpoint parameter is set - the config Source password is used as refresh token if token_endpoint parameter is set, and used to exchange with an access token The implementation has only been tested with Gmail. source = imaps+oauthbearer://{username}:{refersh_token}@imap.gmail.com:993? \ client_id=XX&\ client_secret=XX&\ token_endpoint=https%3A%2F%2Faccounts.google.com%2Fo%2Foauth2%2Ftoken client credentials created with https://console.developers.google.com/apis/credentials refresh token created with https://github.com/google/gmail-oauth2-tools/blob/master/python/oauth2.py rel: https://todo.sr.ht/~sircmpwn/aerc2/42 --- go.mod | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'go.mod') diff --git a/go.mod b/go.mod index 1c3d156..ab0a033 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/emersion/go-imap v1.0.0-beta.6 github.com/emersion/go-imap-idle v0.0.0-20190519112320-2704abd7050e github.com/emersion/go-message v0.10.3 - github.com/emersion/go-sasl v0.0.0-20190520160400-47d427600317 + github.com/emersion/go-sasl v0.0.0-20190704090222-36b50694675c github.com/emersion/go-smtp v0.11.1 github.com/gdamore/tcell v1.1.2 github.com/go-ini/ini v1.42.0 @@ -28,6 +28,7 @@ require ( github.com/smartystreets/assertions v1.0.0 // indirect github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a // indirect github.com/stretchr/testify v1.3.0 + golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed // indirect gopkg.in/ini.v1 v1.42.0 // indirect ) -- cgit v1.2.3