Closed strizhechenko closed 3 years ago
Ha-ha, API isn't idempotent, it returns refresh token only on first authentication by user: https://stackoverflow.com/questions/10827920/not-receiving-google-oauth-refresh-token/10857806#10857806
"Fixed" by adding:
def AccountsUrl(command):
@@ -184,6 +184,8 @@ def GeneratePermissionUrl(client_id, scope='https://mail.google.com/'):
params['redirect_uri'] = REDIRECT_URI
params['scope'] = scope
params['response_type'] = 'code'
+ params['prompt']='consent'
+ params['access_type']='offline'
return '%s?%s' % (AccountsUrl('o/oauth2/auth'),
FormatUrlParams(params))
I'm trying to set up offlineimap to sync my mail from gmail. As the guide in
.offlineimaprc.full
mentions this repo I've cloned it and trying to run:but I've got a KeyError on 'refresh_token':
So I've added some prints to see the response:
Access_token is fine, auth works but for a single hour only. But I want a permanent solution mentioned in this wiki page. Am I doing something wrong? Problem seems to be on API side, maybe something is changed and not shown in the docs yet?