0%

Third party login with Google - Create credentials

從申請 Google OAuth2.0 憑證到應用 - 申請憑證

  • 登入 Google Cloud 後,點選右上控制台
  • 建立並進入專案
  • 左方導覽列 > API和服務 > OAuth 同意畫面

設定OAuth 同意畫面

設定User Type

決定怎樣的使用者可以登入

設定應用程式資訊

設定應用程式範圍

表示您要求使用者為應用程式授予的權限,如允許第三方取得我在google的個人資訊、相片等等

建立憑證 (選擇 OAuth 用戶端 ID)

設定應用程式類別

設定JavaScript 來源/Redirect URL

取得憑證資訊

以下為憑證資訊範例

1
2
3
4
5
6
7
8
9
10
11
12
13
{
"web" : {
"client_id":"xxx",
"project_id":"enterprisewifidev",
"auth_uri":"https://accounts.google.com/o/oauth2/auth",
"token_uri":"https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth
2/v1/certs",
"client_secret":"xxx",
"redirect_uris":["http://localhost:3000"],
"javascript_origins":["http://localhost:3000"]
}
}