oauth.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:illinois-jobslink 作者: uchicagotechteam 项目源码 文件源码
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'))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号