2024-10-01 00:18:02 发布
网友
我正在开发一个程序,用python quickstart在google calendare上标记约会,一切正常,但是程序从纯文本文件中读取client\u secret.json和credential.json信息,而这些信息应该受到保护
我想对文件进行加密,但是如何通过传递文件内容(字符串)而不是文件本身来执行client.flow\u from\u clientsecrets过程
我想避免编辑googleapi python客户端
您可以使用OAuth2WebServerFlow:
OAuth2WebServerFlow
from oauth2client.client import OAuth2WebServerFlow flow_params = { 'access_type': 'offline', 'prompt': 'consent' } flow_scopes = [ "https://www.googleapis.com/auth/calendar.edit", "https://www.googleapis.com/auth/calendar", ] flow = OAuth2WebServerFlow( client_id=client_id, client_secret=client_secret, scope=flow_scopes, redirect_uri='http://www.redirect_uri.com', **flow_params )
您可以使用
OAuth2WebServerFlow
:相关问题 更多 >
编程相关推荐