# 工作筆記 #5 - 第三方登入(2)_Google 需求 --- > 將登入功能加入使用 Google 登入 <br /> 前置作業 --- > 申請 Google 憑證 ### 1. 到 [ Google Cloud Platform 首頁 ](https://console.cloud.google.com/apis/dashboard) <br /> ### 2. 新建立一個新專案  <br /> ### 3. 左邊選單點選 [程式庫],搜尋 [google people api],並啟用 api   <br /> ### 4. 建立 [ OAuth 同意畫面 ] * 點選 [ OAuth 同意畫面 ]  * 填寫應用程式資訊與開發人員聯絡資訊   <br /> ### 5. 建立 [ OAuth 用戶端 ID ] * 點選 [ OAuth 用戶端 ID ]  * 填寫資料   * 完成,取得用戶端 ID  <br /> 程式說明 --- > 使用 Google API ``` <script> function HandleGoogleApiLibrary() { gapi.load('client:auth2', { callback: function () { gapi.client.init({ clientId: Google_appId, scope: 'https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/plus.me' }); }, onerror: function () { console.log("Failed to load libraries"); } }); } </script> <script async defer src="https://apis.google.com/js/api.js" onload="this.onload=function(){};HandleGoogleApiLibrary()" onreadystatechange="if (this.readyState === 'complete') this.onload()"></script> ``` <br /> ###### tags: `login` `google` `第三方登入` --- 參考資料 > https://dotblogs.com.tw/shadow/2019/10/11/030306
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up