def main():
flow = client.flow_from_clientsecrets(CLIENT_SECRETS_PATH, SCOPES)
print('Starting credentials flow...')
credentials = tools.run_flow(flow, NullStorage())
# Save the credentials in the same format as the Cloud SDK's authorized
# user file.
data = {
'type': 'authorized_user',
'client_id': flow.client_id,
'client_secret': flow.client_secret,
'refresh_token': credentials.refresh_token
}
with open(AUTHORIZED_USER_PATH, 'w') as fh:
json.dump(data, fh, indent=4)
print('Created {}.'.format(AUTHORIZED_USER_PATH))
obtain_user_auth.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录