Update to the latest auth and token uris
This commit is contained in:
@@ -333,8 +333,8 @@ class OAuth2WebServerFlow(Flow):
|
||||
"""
|
||||
|
||||
def __init__(self, client_id, client_secret, scope, user_agent,
|
||||
auth_uri='https://www.google.com/accounts/o8/oauth2/authorization',
|
||||
token_uri='https://www.google.com/accounts/o8/oauth2/token',
|
||||
auth_uri='https://accounts.google.com/o/oauth2/auth',
|
||||
token_uri='https://accounts.google.com/o/oauth2/token',
|
||||
**kwargs):
|
||||
"""Constructor for OAuth2WebServerFlow
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ def run(flow, storage):
|
||||
Exceptions:
|
||||
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 authorize_url
|
||||
|
||||
@@ -24,14 +24,14 @@ from apiclient.oauth import CredentialsInvalidError
|
||||
|
||||
|
||||
def main():
|
||||
credentials = Storage('latitude.dat').get()
|
||||
storage = Storage('latitude.dat')
|
||||
credentials = storage.get()
|
||||
if credentials is None or credentials.invalid:
|
||||
flow = OAuth2WebServerFlow(
|
||||
client_id='433807057907.apps.googleusercontent.com',
|
||||
client_secret='jigtZpMApkRxncxikFpR+SFg',
|
||||
scope='https://www.googleapis.com/auth/latitude',
|
||||
user_agent='latitude-cmdline-sample/1.0',
|
||||
xoauth_displayname='Latitude Client Example App')
|
||||
user_agent='latitude-cmdline-sample/1.0')
|
||||
|
||||
credentials = run(flow, storage)
|
||||
|
||||
|
||||
@@ -32,8 +32,7 @@ def main():
|
||||
client_id='433807057907.apps.googleusercontent.com',
|
||||
client_secret='jigtZpMApkRxncxikFpR+SFg',
|
||||
scope='https://www.googleapis.com/auth/urlshortener',
|
||||
user_agent='urlshortener-cmdline-sample/1.0',
|
||||
xoauth_displayname='URL Shortener Client Example App')
|
||||
user_agent='urlshortener-cmdline-sample/1.0')
|
||||
|
||||
credentials = run(flow, storage)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user