Skip to content

GitLab credentials#

คุณสามารถใช้ credentials เหล่านี้เพื่อยืนยันตัวตนกับ node ต่อไปนี้:

Supported authentication methods#

  • API access token
  • OAuth2 (แนะนำ)

ดูข้อมูลเพิ่มเติมเกี่ยวกับบริการนี้ได้ที่ GitLab's API documentation

Using API access token#

ในการกำหนดค่า credential นี้ คุณจะต้องมีบัญชี GitLab และ:

  • URL ของ GitLab Server ของคุณ
  • Access Token

วิธีตั้งค่า credential:

  1. ใน GitLab เลือก avatar ของคุณ จากนั้นเลือก Edit profile
  2. ในแถบด้านข้างซ้าย เลือก Access tokens
  3. เลือก Add new token
  4. ป้อน Name สำหรับ token เช่น n8n integration
  5. ป้อน expiry date สำหรับ token หากคุณไม่ป้อนวันหมดอายุ GitLab จะตั้งค่าโดยอัตโนมัติเป็น 365 วันหลังจากวันที่ปัจจุบัน
    • token จะหมดอายุในวันหมดอายุนั้น ณ เวลาเที่ยงคืน UTC
  6. เลือก Scopes ที่ต้องการ สำหรับ node GitLab ให้ใช้ scope api เพื่อให้สิทธิ์เข้าถึงฟังก์ชันทั้งหมดของ node ได้อย่างง่ายดาย หรือดูที่ Personal access token scopes เพื่อเลือก scopes สำหรับฟังก์ชันที่คุณต้องการใช้
  7. เลือก Create personal access token
  8. คัดลอก access token ที่สร้างขึ้นนี้และป้อนลงใน credential ของ n8n เป็น Access Token
  9. ป้อน URL ของ GitLab Server ของคุณใน credential ของ n8n

ดูข้อมูลเพิ่มเติมได้ที่ Create a personal access token documentation ของ GitLab

Using OAuth2#

หมายเหตุสำหรับผู้ใช้ n8n Cloud

ผู้ใช้ Cloud ไม่จำเป็นต้องให้รายละเอียดการเชื่อมต่อ เลือก Connect my account เพื่อเชื่อมต่อผ่านเบราว์เซอร์ของคุณ

หากคุณ self-hosting n8n คุณจะต้องมีบัญชี GitLab จากนั้นสร้าง GitLab application ใหม่:

  1. ใน GitLab เลือก avatar ของคุณ จากนั้นเลือก Edit profile
  2. ในแถบด้านข้างซ้าย เลือก Applications
  3. เลือก Add new application
  4. ป้อน Name สำหรับ application ของคุณ เช่น n8n integration
  5. ใน n8n คัดลอก OAuth Redirect URL ป้อนเป็น Redirect URI ของ GitLab
  6. เลือก Scopes ที่ต้องการ สำหรับ node GitLab ให้ใช้ scope api เพื่อให้สิทธิ์เข้าถึงฟังก์ชันทั้งหมดของ node ได้อย่างง่ายดาย หรือดูที่ Personal access token scopes เพื่อเลือก scopes สำหรับฟังก์ชันที่คุณต้องการใช้
  7. เลือก Save application
  8. คัดลอก Application ID และป้อนเป็น Client ID ใน credential ของ n8n
  9. คัดลอก Secret และป้อนเป็น Client Secret ใน credential ของ n8n

ดูข้อมูลเพิ่มเติมได้ที่เอกสาร Configure GitLab as an OAuth 2.0 authentication identity provider ของ GitLab ดูข้อมูลเพิ่มเติมเกี่ยวกับ OAuth2 และ GitLab ได้ที่ GitLab OAuth 2.0 identity provider API documentation