It would be helpful if there were an obvious way to provide a refresh token when creating a session. For our use case we do not support any Auth flows other than Authorization Code, but for headless execution we need to be able to persist a token somewhere and provide it.
Ideally this would be an argument to the constructors for OAuth2AuthorizationCodeFlow and the PKCE variant, but a set_refresh_token() method, or a new subclass would also be OK.
I'm happy to prepare a PR if there's a preferred approach.
You can always implement your own token cache and have get_token method returning whatever token you want to use.
Refer to documentation on how to assign a token cache.
It would be helpful if there were an obvious way to provide a refresh token when creating a session. For our use case we do not support any Auth flows other than Authorization Code, but for headless execution we need to be able to persist a token somewhere and provide it.
Ideally this would be an argument to the constructors for OAuth2AuthorizationCodeFlow and the PKCE variant, but a
set_refresh_token()
method, or a new subclass would also be OK.I'm happy to prepare a PR if there's a preferred approach.