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:
@ -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:
|
||||
|
@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user