iT邦幫忙

2025 iThome 鐵人賽

DAY 15
0
生成式 AI

生成式AI 與 Notion 的碰撞 ?! 你還在 ctrl+c ctrl+v ?系列 第 15

Day 15 | n8n 串接 Google Calendar:憑證 (Credential) 設定教學

  • 分享至 

  • xImage
  •  

昨天我們完成了串接 Google Calendar 節點的基本設定,今天的目標是建立並設定 Google Calendar 的憑證 (Credential),讓 n8n 能夠成功獲取您 Google 日曆的資料。

步驟一:在 n8n 建立新的 Credential

  1. 首先,點開 Credential to connect with → 點開 credential to connent with → 下拉選單選擇 + create new credential

    https://ithelp.ithome.com.tw/upload/images/20250929/20178023bjzgNgh3as.jpg

  2. 然後複製 OAuth Redirect URL

    https://ithelp.ithome.com.tw/upload/images/20250929/20178023Nl0sKx4boB.png

步驟二:設定 Google Cloud Console

  1. 前往 Google Cloud Platform,點選右上角的「控制台」。

    https://ithelp.ithome.com.tw/upload/images/20250929/20178023uab24l8A8V.png

  2. 在頂端的搜尋框輸入 google calendar api 並前往設定頁面。

    https://ithelp.ithome.com.tw/upload/images/20250929/2017802346pHPuupSA.png

  3. 在 API 憑證設定中,將剛剛從 n8n 複製的網址分別填入「已授權的 JavaScript 來源」與「已授權的重新導向 URI」。

    注意:在本地端 (localhost) 環境下,需要將 n8n 的回調網址拆成兩部分填寫。

    https://ithelp.ithome.com.tw/upload/images/20250929/201780239V2YSqiClL.png

  4. 設定完成後,將 Google Cloud 提供的「用戶端 ID」和「用戶端密鑰」複製並貼回到 n8n 的對應欄位中。

    https://ithelp.ithome.com.tw/upload/images/20250929/20178023D9OKRrKSQv.png

  5. 點擊 Sign in with Google 進行帳號連結。

    https://ithelp.ithome.com.tw/upload/images/20250929/20178023shlU1SZu52.png

步驟三:疑難排解 - 解決「已封存的存取權」問題

點擊登入後,您可能會遇到「已封存的存取權」的錯誤訊息,這是因為您的 Google Cloud 專案處於測試模式,需要手動將您的帳號加入測試使用者名單。

https://ithelp.ithome.com.tw/upload/images/20250929/20178023O2NtmrTAx2.png

請依照以下步驟操作:

  1. 前往 Google Cloud Console
    • 打開您的 Google Cloud 專案。
  2. 導覽至「OAuth 同意畫面」
    • 在左上角的導覽選單 (☰) 中,選擇 「API 和服務」 → 「OAuth 同意畫面」 (OAuth consent screen)。
  3. 新增測試使用者
    • 在「OAuth 同意畫面」頁面中,確認「發布狀態」(Publishing status) 是 「測試」
    • 往下找到 「目標對象」  的區塊。
    • 點擊 「+ ADD USERS」 按鈕。
    • 在跳出的視窗中,輸入您要用來登入的 Google 帳號(可以多加帳號)。
    • 點擊 「儲存」 (Save)。

完成後,再回到 n8n 點擊一次 sign in with google ,此時會出現「這個應用程式未經 Google 驗證」的警告畫面。請點擊「繼續」,並在下一個畫面同意授權即可。

https://ithelp.ithome.com.tw/upload/images/20250929/20178023OsxWbAsF6b.png

步驟四:驗證與測試

如果憑證欄位出現綠色打勾的已連結帳號,代表您已成功串接!

https://ithelp.ithome.com.tw/upload/images/20250929/20178023p9gHQOUXkx.png

如果憑證欄位出現綠色打勾的已連結帳號,代表您已成功串接!

https://ithelp.ithome.com.tw/upload/images/20250929/20178023nxXoEWy0CG.png


今日總結:

今天我們成功設定了 Google Calendar 節點的憑證,讓 n8n 可以讀取我們每天的 Google 日曆行程。
明天,我們將會教大家如何串接 Notion 節點,為後續的自動化流程獲取所有必要的資料。
下一篇!n8n x Notion 節點串接,敬請期待!


上一篇
Day 14 | n8n 定時節點與 Google Calendar 串接
系列文
生成式AI 與 Notion 的碰撞 ?! 你還在 ctrl+c ctrl+v ?15
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言