Skip to content
GitHub

Credentials နဲ့ Security

n8n ကနေ Gmail, Slack, Google Sheets စတဲ့ App တွေနဲ့ ချိတ်ဆက်ဖို့ Authentication လိုအပ်ပါတယ်။ Credentials ဆိုတာ အဲ့ဒီ API Keys, Passwords, OAuth Tokens တွေကို Encrypted ပုံစံနဲ့ n8n မှာ လုံခြုံအောင် သိမ်းဆည်းပေးတဲ့ စနစ်ပါ။

Credentials မရှိဘဲနဲ့ n8n က External App တွေကို လှမ်းသုံးလို့ မရပါဘူး။ Credentials ချိတ်ဆက်ပြီးမှသာ Data ကို လုံခြုံစွာ ဖလှယ်နိုင်မှာပါ။

Credential အမျိုးအစားများ

Section titled “Credential အမျိုးအစားများ”

App ကနေ ထုတ်ပေးတဲ့ Unique Token လေးကို သုံးပြီး Authenticate လုပ်တာပါ -

API Key Example:
sk-proj-AbCdEfGhIjKlMnOpQrStUv1234567890
n8n HTTP Request Node မှာ:
Header: Authorization: Bearer {{ credential.apiKey }}

API Key ကိုသုံးတဲ့ App များ: OpenAI, Anthropic, Airtable, Mailchimp

User ကို External Service ရဲ့ Login Page ဆီ လမ်းကြောင်းလွှဲပေးပြီး၊ User ကိုယ်တိုင် Permission လာပေးရတဲ့ စနစ်ပါ -

n8n Login Request ပို့
1. Redirect
Google Login Page User Auth လုပ်
2. Auth Code
Auth Code ပြန်ရ
3. Token Exchange
Access Token Encrypted & Stored

OAuth 2.0 Flow — User ရဲ့ Permission ဖြင့် Token ရယူခြင်း

OAuth ကိုသုံးတဲ့ App များ: Gmail, Google Sheets, Slack, GitHub, Notion

Basic Auth:
Username: user@example.com
Password: mypassword123

ဥပမာ: MySQL Database, Custom APIs

Step 1: Credentials Menu ကို သွားပါ

Section titled “Step 1: Credentials Menu ကို သွားပါ”

Left Sidebar ကနေ Credentials+ Add Credential ကို သွားပါ။

App တစ်ခုကို Search လုပ်ပြီး (ဥပမာ “Gmail”)၊ Credential Type ကို ရွေးပါ — Gmail (OAuth2) ဒါမှမဟုတ် Gmail (IMAP)။

Step 2: Authentication Type ရွေးပါ

Section titled “Step 2: Authentication Type ရွေးပါ”

ဥပမာ — Gmail Credential ဖန်တီးရာမှာ နာမည်ပေးပြီး၊ Client ID နဲ့ Client Secret ကို ထည့်ပါ။ အဲ့ဒီနောက် “Connect my account” ကို နှိပ်ရင် OAuth Login Page ကို ပြောင်းသွားပါလိမ့်မယ်။

Step 3: Credential ကို Node မှာ ယူသုံးပါ

Section titled “Step 3: Credential ကို Node မှာ ယူသုံးပါ”

Gmail Node ကို Configure လုပ်တဲ့အခါ Credential Dropdown ထဲကနေ ခုနက ဖန်တီးထားတဲ့ Credential ကို ပြန်ရွေးပေးလိုက်ရုံပါပဲ -

Gmail Node:
Credential: [My Gmail Account ▼]
Resource: [Message]
Operation: [Send]

1. Credential ကို Workflow ထဲ Hard-code မလုပ်ပါနဲ့

Section titled “1. Credential ကို Workflow ထဲ Hard-code မလုပ်ပါနဲ့”
❌ မကောင်းသော နည်း (Hard-coded API Key):
HTTP Request → Header:
Authorization: Bearer sk-proj-AbCdEf...
✅ ကောင်းသော နည်း (n8n Credential):
Create credential named "OpenAI API"
HTTP Request → Credential: [OpenAI API ▼]

2. Environment Variables သုံးပါ

Section titled “2. Environment Variables သုံးပါ”

Self-hosting လုပ်ထားတယ်ဆိုရင် Sensitive Config တွေကို .env File ထဲမှာ ထည့်ပါ -

Terminal window
# .env file
N8N_ENCRYPTION_KEY=your-random-32-char-secret-key
DB_TYPE=postgresdb
DB_POSTGRESDB_PASSWORD=your-db-password
WEBHOOK_URL=https://your-domain.com

3. Credential Scope ကို Limit လုပ်ပါ

Section titled “3. Credential Scope ကို Limit လုပ်ပါ”

Google API ကို ဖန်တီးတဲ့အခါ Workflow က တကယ်လိုအပ်တဲ့ Permission ကိုပဲ တောင်းပါ -

ဥပမာ - Google Sheets Credential:
❌ "Full Google Account Access" မတောင်းပါ
✅ "Google Sheets only" Scope ကိုသာ သုံးပါ

4. Credential ကို Share မလုပ်ပါ

Section titled “4. Credential ကို Share မလုပ်ပါ”

n8n User Roles -

  • Owner — Full access (Credential တွေကိုပါ စီမံနိုင်တယ်)
  • Admin — Workflow တွေ စီမံနိုင်တယ် + Credentials ကို သုံးနိုင်တယ်
  • Member — Workflow ကိုပဲ သုံးလို့ရတယ် (Credential တွေကို မြင်ခွင့်မရှိဘူး)

Google Services ချိတ်ဆက်ဥပမာ

Section titled “Google Services ချိတ်ဆက်ဥပမာ”

Google Sheets Credential ဖန်တီးနည်း (OAuth2) -

  1. console.cloud.google.com ကို သွားပါ။
  2. Project အသစ် ဖန်တီးပါ (သို့မဟုတ် ရှိပြီးသား Project ကို ရွေးပါ)။
  3. APIs & ServicesEnable APIs → “Google Sheets API” ကို ဖွင့်ပါ။
  4. OAuth consent screen ကို Configure လုပ်ပါ။
  5. CredentialsCreate CredentialsOAuth 2.0 Client ID ယူပါ။

Client ID နဲ့ Client Secret ကို n8n Credential Form ထဲ ထည့်ပြီး “Sign in with Google” ကို နှိပ်ပါ။ Google Login Page ကို ရောက်သွားရင် Permission ပေးလိုက်ပါ။

Credential Sharing အကြောင်း

Section titled “Credential Sharing အကြောင်း”

n8n Enterprise မှာတော့ Credential ကို Team Members တွေနဲ့ Share နိုင်ပါတယ် -

Sharing a Credential:
Credential → Settings → Share with: [Select Users]

Share ပေးလိုက်တဲ့ User တွေက Credential ကို Workflow ထဲမှာ ယူသုံးနိုင်ပါတယ်။ ဒါပေမဲ့ API Key ကိုတော့ သူတို့ မျက်စိနဲ့ မြင်ရမှာ မဟုတ်ပါဘူး — Security အရ တော်တော်လေး စိတ်ချရပါတယ် ခင်ဗျာ။

နောက်သင်ခန်းစာမှာ ပထမဆုံး Workflow ကို အတူတူ ဆောက်ကြပါမယ်!