Update to the latest auth and token uris

This commit is contained in:
Joe Gregorio
2011-03-10 08:35:11 -05:00
parent ff52fa341e
commit b577f99174
4 changed files with 7 additions and 8 deletions

View File

@@ -333,8 +333,8 @@ class OAuth2WebServerFlow(Flow):
""" """
def __init__(self, client_id, client_secret, scope, user_agent, def __init__(self, client_id, client_secret, scope, user_agent,
auth_uri='https://www.google.com/accounts/o8/oauth2/authorization', auth_uri='https://accounts.google.com/o/oauth2/auth',
token_uri='https://www.google.com/accounts/o8/oauth2/token', token_uri='https://accounts.google.com/o/oauth2/token',
**kwargs): **kwargs):
"""Constructor for OAuth2WebServerFlow """Constructor for OAuth2WebServerFlow

View File

@@ -36,7 +36,7 @@ def run(flow, storage):
Exceptions: Exceptions:
RequestError: if step2 of the flow fails. RequestError: if step2 of the flow fails.
""" """
authorize_url = flow.step1_get_authorize_url('oob') authorize_url = flow.step1_get_authorize_url('http://localhost:8080/')
print 'Go to the following link in your browser:' print 'Go to the following link in your browser:'
print authorize_url print authorize_url

View File

@@ -24,14 +24,14 @@ from apiclient.oauth import CredentialsInvalidError
def main(): def main():
credentials = Storage('latitude.dat').get() storage = Storage('latitude.dat')
credentials = storage.get()
if credentials is None or credentials.invalid: if credentials is None or credentials.invalid:
flow = OAuth2WebServerFlow( flow = OAuth2WebServerFlow(
client_id='433807057907.apps.googleusercontent.com', client_id='433807057907.apps.googleusercontent.com',
client_secret='jigtZpMApkRxncxikFpR+SFg', client_secret='jigtZpMApkRxncxikFpR+SFg',
scope='https://www.googleapis.com/auth/latitude', scope='https://www.googleapis.com/auth/latitude',
user_agent='latitude-cmdline-sample/1.0', user_agent='latitude-cmdline-sample/1.0')
xoauth_displayname='Latitude Client Example App')
credentials = run(flow, storage) credentials = run(flow, storage)

View File

@@ -32,8 +32,7 @@ def main():
client_id='433807057907.apps.googleusercontent.com', client_id='433807057907.apps.googleusercontent.com',
client_secret='jigtZpMApkRxncxikFpR+SFg', client_secret='jigtZpMApkRxncxikFpR+SFg',
scope='https://www.googleapis.com/auth/urlshortener', scope='https://www.googleapis.com/auth/urlshortener',
user_agent='urlshortener-cmdline-sample/1.0', user_agent='urlshortener-cmdline-sample/1.0')
xoauth_displayname='URL Shortener Client Example App')
credentials = run(flow, storage) credentials = run(flow, storage)