取得 Google API 用戶端 ID
Google 登入會管理 OAuth 2.0 流程和憑證生命週期,簡化與 Google API 的整合作業。使用者隨時可以撤銷應用程式存取權。
您必須先建立用來呼叫 3P Authorization API 的用戶端 ID,才能將 Google 3P Authorization 程式庫整合至網站。
如要建立 Google API 控制台專案和用戶端 ID,請按一下下列按鈕:
設定專案
設定專案時,請選取網路瀏覽器用戶端類型,並指定應用程式的來源 URI。執行測試時,http://localhost
和 http://localhost:<port_number>
都必須加入「已授權的 JavaScript 來源」欄位。
設定完成後,請記下建立的用戶端 ID,您需要用戶端 ID 才能完成後續步驟。(系統也會建立用戶端密鑰,但您只需要用於伺服器端作業。)
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-11-09 (世界標準時間)。
[null,null,["上次更新時間:2024-11-09 (世界標準時間)。"],[[["Google Sign-In streamlines the use of Google APIs by managing the OAuth 2.0 flow and token lifecycle, allowing users to revoke access at any time."],["Before integrating Google 3P Authorization, you need to create a client ID within a Google API Console project, specifying the Web browser client type and authorized origins including localhost for testing."],["After project configuration, note the generated client ID, which is essential for subsequent integration steps."]]],[]]