Allow authorization via XOAUTH2 using access token

Signed-off-by: Slava Kardakov <ojab@ojab.ru>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
ojab
2015-12-28 13:53:53 +00:00
committed by Nicolas Sebrecht
parent 72850e3c23
commit cfa704bbf2
3 changed files with 11 additions and 3 deletions

View File

@ -95,10 +95,10 @@ class IMAPServer:
self.tlslevel = repos.gettlslevel()
self.oauth2_refresh_token = repos.getoauth2_refresh_token()
self.oauth2_access_token = repos.getoauth2_access_token()
self.oauth2_client_id = repos.getoauth2_client_id()
self.oauth2_client_secret = repos.getoauth2_client_secret()
self.oauth2_request_url = repos.getoauth2_request_url()
self.oauth2_access_token = None
self.delim = None
self.root = None
@ -212,7 +212,7 @@ class IMAPServer:
def __xoauth2handler(self, response):
if self.oauth2_refresh_token is None:
if self.oauth2_refresh_token is None and self.oauth2_access_token is None:
return None
if self.oauth2_access_token is None:

View File

@ -276,6 +276,9 @@ class IMAPRepository(BaseRepository):
def getoauth2_refresh_token(self):
return self.getconf('oauth2_refresh_token', None)
def getoauth2_access_token(self):
return self.getconf('oauth2_access_token', None)
def getoauth2_client_id(self):
return self.getconf('oauth2_client_id', None)