参考资料

https://github.com/SoraWebui/SoraWebui/blob/login/help/Google-Auth.zh-CN.md: 这个文档有点老旧,不符合现在最新的操作流程。

申请

网址: https://console.cloud.google.com

Step: 新建 Project

  • Project Name: 随便填写

Step: 选择这个项目

进入这个项目的控制面板页面

Step: 进入 Credentials 页面

  • 进入路径:APIs & Services -> Credentials
  • 点击 Configure Consent Sreeen按钮,然后点击Get Started按钮,进入 Project configuration 页面

进入 Project configuration 页面

APP Information

  • APP Name: 填写你的项目的名称
  • User Support email:

Audience

选择 External

Contact Information

谷歌通知你来使用的

Finish

确保已经同意

点击创建

点击 create 按钮,进行创建。

Step: 配置APP基本信息

  • 路径:APIs & Services -> OAuth consent screen -> Branding
  • App logo 不要上传:请勿上传 App logo,这样可以免审核成为正式项目。 (推荐)
  • App domain:
    • Application home page
    • Application
  • Authorized domains: your-domain

Step: 创建Client

  • 路径:APIs & Services -> OAuth consent screen -> Clients
  • 点击 create client 按钮
  • 选择 Application Type
  • 填写 Name
  • Authorized JavaScript origins
    • http://localhost
    • https://your-domain
  • Authorized redirect URIs
    • http://localhost/api/auth/callback/google
    • https://your-domain/api/auth/callback/google
  • 点击 Create按钮。会弹出一个OAuth client created弹窗,请妥善保管Client ID, Client secret

Step: 配置测试用户

  • 路径:APIs & Services -> OAuth consent screen -> Audience
  • 点击 add users按钮

Step: 选择 userinfo.email 和 userinfo.profile

  • 路径:APIs & Services -> OAuth consent screen -> Data Access
  • 点击Add or remove scopes按钮,在范围中添加 userinfo.email & userinfo.profile