Credentials နှင့် Security
Credentials ဆိုတာ ဘာလဲ?
Section titled “Credentials ဆိုတာ ဘာလဲ?”n8n ကနေ Gmail, Slack, Google Sheets စသည့် App တွေနဲ့ ချိတ်ဆက်ဖို့ Authentication လိုအပ်ပါတယ်။ Credentials ဆိုတာ ထိုသော API Keys, Passwords, OAuth Tokens တွေကို Encrypted ပုံစံဖြင့် n8n မှာ သိမ်းဆည်းပုံပါ။
Credentials မရှိဘဲ n8n သည် External App ကို Access ရနိုင်မည်မဟုတ်ပါ။ Credentials ချိတ်ဆက်ပြီးမှ Data ကို လုံခြုံစွာ ဖလှယ်နိုင်သည်။
Credential အမျိုးအစားများ
Section titled “Credential အမျိုးအစားများ”1. API Key
Section titled “1. API Key”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
2. OAuth 2.0
Section titled “2. OAuth 2.0”User ကို External Service ၏ Login Page သို့ Redirect လုပ်ပြီး Permission ကို User မှ Grant ပေးသည်:
OAuth 2.0 Flow — User ၏ Permission ဖြင့် Token ရယူခြင်း
OAuth ကိုသုံးသော App များ: Gmail, Google Sheets, Slack, GitHub, Notion
3. Basic Auth / Username & Password
Section titled “3. Basic Auth / Username & Password”Basic Auth: Username: user@example.com Password: mypassword123ဥပမာ: MySQL Database, Custom APIs
Credential ဖန်တီးနည်း
Section titled “Credential ဖန်တီးနည်း”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 ဖန်တီးရာတွင် Name သတ်မှတ်ပြီး Client ID, Client Secret ထည့်ကာ “Connect my account” ကို နှိပ်ပါ။ OAuth Login Page ကို Redirect ဖြစ်မည်။
Step 3: Credential ကို Node မှာ Use လုပ်ပါ
Section titled “Step 3: Credential ကို Node မှာ Use လုပ်ပါ”Gmail Node ကို Configure လုပ်ရင် Credential Dropdown မှ ရှေ့မှ ဖန်တီးထားသော Credential ကို ရွေးလိုက်ရုံပါ:
Gmail Node: Credential: [My Gmail Account ▼] Resource: [Message] Operation: [Send]Security Best Practices
Section titled “Security Best Practices”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 ထဲ ထည့်ပါ:
# .env fileN8N_ENCRYPTION_KEY=your-random-32-char-secret-keyDB_TYPE=postgresdbDB_POSTGRESDB_PASSWORD=your-db-passwordWEBHOOK_URL=https://your-domain.com3. 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 manage + Credentials
- Member — Workflow သာ (Credential မမြင်နိုင်)
Google Services ချိတ်ဆက်ဥပမာ
Section titled “Google Services ချိတ်ဆက်ဥပမာ”Google Sheets Credential ဖန်တီးနည်း (OAuth2):
Step 1: Google Cloud Console
Section titled “Step 1: Google Cloud Console”- console.cloud.google.com သွားပါ
- Project အသစ် ဖန်တီးပါ (သို့မဟုတ် ရှိသည့် Project ကို ရွေးပါ)
- APIs & Services → Enable APIs → “Google Sheets API” ဖွင့်ပါ
- OAuth consent screen Configure လုပ်ပါ
- Credentials → Create Credentials → OAuth 2.0 Client ID
Step 2: n8n ထဲ ထည့်ပါ
Section titled “Step 2: n8n ထဲ ထည့်ပါ”Client ID နှင့် Client Secret ကို n8n Credential Form ထဲ ထည့်ပြီး “Sign in with Google” ကို နှိပ်ပါ။ Google Login Page ကို Redirect ဖြစ်ပြီး 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 တွင် Use လုပ်နိုင်သည်။ သို့သော် API Key ကို မမြင်နိုင်ပါ — Security ကို ထိန်းသိမ်းပေးသည်။
နောက်သင်ခန်းစာမှာ ပထမဆုံး Workflow ကို အတူတူ ဆောက်ကြပါမည်!