Open bcarrella opened 6 months ago
Thanks for the PR! Could you please explain what problem is being solved for most users of python/oauth2.py
? Specifically, why might one want to specify --save_token
(note that there's no corresponding --load_token
) and, moreover, why might one need to save both tokens?
Hi, in my use case, I need to develop shell script to schedule email fetching. I need to persist token info between different runs avoiding to refresh token until expires. I would like to delegate all the oauth2 stuff to this script. I need to save both tokens because the initial_token.json
will store refresh_token data, the refreshed_token.js
will store the actual acces_token to use for IMAP authentication. I hope my intention is more clear know. Maybe a --load_token
feature can be useful, but is not my priority at the moment.
Thanks for the explanation! In that case, I'm not sure why the existing --quiet
option isn't sufficient? When a user specifies --generate_oauth2_token
, they would visit the URL in their browser (i.e. this step is necessarily interactive) and presumably then persist the refresh token manually. The subsequent steps should already be able to be wrapped with, say, a shell script. (I believe this is why only --refresh_token
and --generate_oauth2_string
behave differently when --quiet
is specified.)
Implemented new feature to allow saving of tokens to current working directory for later use (e.g. use in script).