On Sat, 17 May 2025, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:
...
Now i tried it with and without this commented out, with the two
accounts i have, but it does not make a difference. In both cases
i have to become interactive, and then both access_token and
refresh_token are updated?
I don't think so. Yes, the access_token will be updated, but without
offline_access, I'll bet you are getting the same, unchanged,
refresh_token that you started with. The only way that a new
refresh_token gets into the resource file is via lines 343-344 in
response_check_and_config_save in the helper program
if resp.get('refresh_token'):
cfg['refresh_token'] = resp.get('refresh_token')
Without offline_access in the scope, there is no refresh_token in the
response and resp.get('refresh_token') fails, so cfg['refresh_token']
doesn't change. Try putting some debug printing around those lines.
In other words, without offline_access in the scope, once your
refresh_token expires, it stays expired until you start all over again
with a fresh template, forcing you to do the interactive thing every
hour or so as your access_token expires. But if you have offline_access
in the scope, an interactive session will get a new refresh token and
you only have to be interactive about once a month.
Stephen Isard