def callback():
flow = client.flow_from_clientsecrets(
'client_secret_911503641744-hn8pinmojgfi1n4poh2n8ssk48bu8idn.apps.googleusercontent.com.json',
scope='https://www.googleapis.com/auth/fusiontables',
redirect_uri='http://localhost:5000/callback')
flow.params['access_type'] = 'offline'
if 'code' not in request.args:
auth_uri = flow.step1_get_authorize_url()
return redirect(auth_uri)
else:
auth_code = request.args.get('code')
credentials = flow.step2_exchange(auth_code)
session['credentials'] = credentials.to_json()
return redirect(url_for('index'))
评论列表
文章目录