Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example of creating a OAuth2Credentials with dummy access token and a working refresh token
import datetime
import httplib2
from oauth2client.client import OAuth2Credentials
credentials = OAuth2Credentials("irrelevant access token",
"some-random-hash.apps.googleusercontent.com", # Client ID
"your-client-secret",
"refresh-token",
datetime.datetime.now(), # token expiry
"https://accounts.google.com/o/oauth2/token")
http = httplib2.Http()
http = credentials.authorize(http)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.