From: Nerijus B. <ne...@us...> - 2021-12-22 08:34:21
|
Hello, Yes, it seems it was because of OAuth consent screen had Publishing status: Testing. I changed it to Production and refresh token does not expire for 2 weeks already. 2021-11-25 11:13, Nerijus Baliunas via Fetchmail-users wrote: > Hello, > > I setup fetchmail to get email from gmail according to README.OAUTH2. It > works for exactly a week > and then stops: > > $ ./fetchmail-oauth2.py -c ... --refresh > Traceback (most recent call last): > File "/home/user/./fetchmail-oauth2.py", line 567, in <module> > main(sys.argv) > File "/home/user/./fetchmail-oauth2.py", line 479, in main > response = RefreshToken(cfg['client_id'],cfg['client_secret'],reftok, > File "/home/user/./fetchmail-oauth2.py", line 368, in RefreshToken > response = urlopen.urlopen(token_url, > File "/usr/lib64/python3.10/urllib/request.py", line 216, in urlopen > return opener.open(url, data, timeout) > File "/usr/lib64/python3.10/urllib/request.py", line 525, in open > response = meth(req, response) > File "/usr/lib64/python3.10/urllib/request.py", line 634, in http_response > response = self.parent.error( > File "/usr/lib64/python3.10/urllib/request.py", line 563, in error > return self._call_chain(*args) > File "/usr/lib64/python3.10/urllib/request.py", line 496, in _call_chain > result = func(*args) > File "/usr/lib64/python3.10/urllib/request.py", line 643, in > http_error_default > raise HTTPError(req.full_url, code, msg, hdrs, fp) > urllib.error.HTTPError: HTTP Error 400: Bad Request > > It starts to work again for a week after I use fetchmail-oauth2.py > --obtain_refresh_token_file. > Could it be because my Google app in OAuth consent screen has Publishing > status: Testing? > > Regards, > Nerijus |