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 ကို Access ရနိုင်မည်မဟုတ်ပါ။ 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 သို့ Redirect လုပ်ပြီး Permission ကို User မှ Grant ပေးသည်:

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 ဖန်တီးရာတွင် 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]

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 manage + 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 ကို 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 ကို အတူတူ ဆောက်ကြပါမည်!