google-id-token-client.py 文件源码

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

项目:appbackendapi 作者: codesdk 项目源码 文件源码
def get_id_token(client_secrets_file, extra_args):
    storage = oauth2client.file.Storage('credentials.dat')
    credentials = storage.get()

    if not credentials or credentials.invalid:
        flow = oauth2client.client.flow_from_clientsecrets(
            client_secrets_file, scope='email')
        credentials = oauth2client.tools.run_flow(
            flow, storage, flags=extra_args)

    # The ID token is used by Cloud Endpoints, not the access token.
    id_token = credentials.token_response['id_token']

    return id_token
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号