Open JasterV opened 1 year ago
It would be also nice to be able to read the tokens directly from a file and do something like
// Get an ApplicationSecret instance by some means. It contains the `client_id` and
// `client_secret`, among other things.
let token_info: TokenInfo = oauth2::read_token_from("/path/to/file");
let authenticator = oauth2::authenticator::AccessTokenAuthenticator::builder(
token_info
)
.persist_tokens_on_disk("path/to/file")
.build()
.await
.map_err(AuthError::AuthenticatorBuilderError)?;
Hi!
I have the following use case:
I generate manually both the token and access token to access the Gmail API. Therefore, I want to use the
AccessTokenAuthenticator
, but I see it only accepts anaccess_token
string, then I understand that there is no internal logic that will refresh the token automatically once the token expires:(Is there a way I can take advantage of the refresh token that I have so the token gets internally refreshed?
Here is my code