python - 如何在没有客户端 ID 和客户端 ID 密码的情况下获取用户的 Google API 令牌?
问题描述
我正在制作一个需要访问 Google 帐户的应用程序。目前,我正在使用漫长的方式来创建项目、创建密钥和许多中间步骤,这使得用户的时间过长。
这是对用户进行身份验证的部分:
google_scopes = ["https://www.googleapis.com/auth/youtube.readonly"]
api_service_name = "youtube"
api_version = "v3"
client_secrets_file = "config.json"
# Get credentials and create an API client
flow = google_auth_oauthlib.flow.InstalledAppFlow.from_client_secrets_file(
client_secrets_file, google_scopes)
credentials = flow.run_console()
youtube = googleapiclient.discovery.build(
api_service_name, api_version, credentials=credentials)
我只想在没有带有密钥的配置文件的情况下完成它。只是一个需要用户登录的链接,然后返回令牌。
解决方案
推荐阅读
- python-3.x - 将 +10,000 个数据从 ec2 插入 rds postgres 太慢了
- javascript - 一遍又一遍地 ping 数据库的更好选择?
- excel - 检查范围内的任何单元格是否有值
- jquery - Next.js “jQuery 需要一个带有文档的窗口”,定义 jsdom 会产生 Unexpected token
- .net-core - oData Expand 不显示 .net core 2.1 中的其他属性 json
- reactjs - TypeError:无法设置未定义的属性“runtimeChunk”
- javascript - 如何使用从节点服务器发送的 AWS SES 撰写电子邮件,而不是最终出现在 Gmail 的“促销”选项卡中?
- tomcat - 启动Tomcat有问题
- sql-server - 一个进程中有多少事务
- python - 带赋值操作的列表理解