iT邦幫忙

3

[已解決]Google OAuth 2.0 驗證失敗問題

  • 分享至 

  • xImage

小弟希望能有Google Task的桌面版,到Github找到google-tasks-desktop
使用Github的google-tasks-desktop 在驗證上出現localhost 拒絕連線的問題


https://ithelp.ithome.com.tw/upload/images/20221026/20134314Vy2pFkZpuZ.png
連結:https://github.com/Pong420/google-tasks-desktop


之後參考「設置 OAuth 2.0」
https://ithelp.ithome.com.tw/upload/images/20221026/20134314IXIvnNQigz.png
連結:https://support.google.com/cloud/answer/6158849


啟用Google Tasks API
https://ithelp.ithome.com.tw/upload/images/20221026/20134314yzocHLrqos.png


如下都是參考google以及github的步驟,也新增自己成為測試使用者
https://ithelp.ithome.com.tw/upload/images/20221026/20134314WYl0yyl9wT.png
https://ithelp.ithome.com.tw/upload/images/20221026/2013431492e8RHzpE1.jpg


接續放入OAuth2 JSON file,以及授權存取
https://ithelp.ithome.com.tw/upload/images/20221026/20134314ZcotMquz3N.png
https://ithelp.ithome.com.tw/upload/images/20221026/20134314HkTXKJVDRI.jpg


到按下繼續後
https://ithelp.ithome.com.tw/upload/images/20221026/2013431419EOskvO1a.png
出現localhost 拒絕連線的問題


已找出問題所在

從Google OAuth 2.0 下載的json檔缺少一段程式碼導致錯誤
缺少-> ["urn:ietf:wg:oauth:2.0:oob", "http://localhost"]

Github參考程式碼

{
  "installed": {
    "client_id": "...",
    "project_id": "...",
    "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/oauth2/v1/certs",
    "client_secret": "...",
    "redirect_uris": ["urn:ietf:wg:oauth:2.0:oob", "http://localhost"]
  }
}

修改後就能正常使用了/images/emoticon/emoticon01.gif

正常畫面
https://ithelp.ithome.com.tw/upload/images/20221027/20134314tLBgyKg0Hm.jpg

二次補充

遇到GOOGLE-TASK 開啟後卡住無法顯示-解決方法

▌處理方式:
C:\Users\"使用者名稱"\AppData\Roaming\google-tasks-desktop
刪除整個資料夾後,重新打開再次驗證OAuth 2.0即可

辰辰 iT邦新手 4 級 ‧ 2022-10-26 18:43:48 檢舉
已自行解決---解決方法如上
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友回答

立即登入回答