Created
August 24, 2012 14:10
-
-
Save milancermak/3451039 to your computer and use it in GitHub Desktop.
Example of creating a OAuth2Credentials with dummy access token and a working refresh token
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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