I have an instance of google.oauth2.service_account.Credentials
. How should I refresh these credentials. I get creds.expired
as True.
While reading the docs here, I got my answer. WE can refresh the credentials and get the token using following approach :
import google.auth.transport.requests
import requests
request = google.auth.transport.requests.Request()
credentials.refresh(request)