{"id":119497,"date":"2025-09-25T16:08:46","date_gmt":"2025-09-25T09:08:46","guid":{"rendered":"https:\/\/tino.vn\/blog\/?p=119497"},"modified":"2026-10-23T18:54:16","modified_gmt":"2026-10-23T11:54:16","slug":"bao-mat-credentials-va-api-keys-trong-n8n","status":"publish","type":"post","link":"https:\/\/tino.vn\/blog\/bao-mat-credentials-va-api-keys-trong-n8n\/","title":{"rendered":"C\u00e1ch b\u1ea3o m\u1eadt credentials v\u00e0 API key trong n8n t\u1ef1 host"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>n8n m\u00e3 h\u00f3a m\u1ecdi credential trong database b\u1eb1ng kh\u00f3a N8N_ENCRYPTION_KEY,<\/strong> n\u00ean vi\u1ec7c \u0111\u1ea7u ti\u00ean khi t\u1ef1 host l\u00e0 \u0111\u1eb7t kh\u00f3a ri\u00eang, sao l\u01b0u kh\u00f3a t\u00e1ch kh\u1ecfi m\u00e1y ch\u1ee7 v\u00e0 kh\u00f4ng d\u00e1n API key th\u1eb3ng v\u00e0o node. Sau \u0111\u00f3 gi\u1edbi h\u1ea1n ai \u0111\u01b0\u1ee3c xem credential, b\u1eadt 2FA v\u00e0 xoay v\u00f2ng key \u0111\u1ecbnh k\u1ef3. Kho b\u00ed m\u1eadt ngo\u00e0i nh\u01b0 Vault ch\u1ec9 c\u00f3 \u1edf g\u00f3i tr\u1ea3 ph\u00ed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Credential l\u00e0 th\u00f4ng tin x\u00e1c th\u1ef1c (API key, Client ID\/Secret, token, m\u1eadt kh\u1ea9u) m\u00e0 node <a href=\"https:\/\/tino.vn\/blog\/n8n-la-gi\/\">n8n<\/a> d\u00f9ng \u0111\u1ec3 g\u1ecdi d\u1ecbch v\u1ee5 kh\u00e1c. B\u00e0i \u00e1p d\u1ee5ng cho n8n t\u1ef1 host, v\u00ed d\u1ee5 sau khi <a href=\"https:\/\/tino.vn\/blog\/cach-cai-dat-n8n-tren-vps\/\">c\u00e0i n8n tr\u00ean VPS<\/a>; c\u00e1c m\u1ee5c v\u1ec1 kh\u00f3a m\u00e3 h\u00f3a kh\u00f4ng \u00e1p d\u1ee5ng cho n8n Cloud.<\/p>\n\n\n\n<h2 id=\"V\u00ec_sao_c\u1ea7n_b\u1ea3o_m\u1eadt_credentials_v\u00e0_API_key_trong_n8n?\">V\u00ec sao c\u1ea7n b\u1ea3o m\u1eadt credentials v\u00e0 API key trong n8n?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">M\u1ed9t n8n t\u1ef1 host th\u01b0\u1eddng gi\u1eef c\u00f9ng l\u00fac kh\u00f3a c\u1ee7a Google, CRM, c\u1ed5ng thanh to\u00e1n, AI, n\u00ean l\u1ed9 credential \u1edf n8n c\u00f3 th\u1ec3 m\u1edf \u0111\u01b0\u1eddng v\u00e0o nhi\u1ec1u h\u1ec7 th\u1ed1ng c\u00f9ng l\u00fac. R\u1ee7i ro g\u1ed3m m\u1ea5t quy\u1ec1n ki\u1ec3m so\u00e1t, ph\u00e1t sinh chi ph\u00ed v\u00e0 r\u1eafc r\u1ed1i ph\u00e1p l\u00fd.<\/p>\n\n\n\n<h3 id=\"R\u1ee7i_ro_th\u01b0\u1eddng_g\u1eb7p_khi_l\u1ed9_credential\">R\u1ee7i ro th\u01b0\u1eddng g\u1eb7p khi l\u1ed9 credential<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>M\u1ea5t quy\u1ec1n ki\u1ec3m so\u00e1t:<\/strong> ng\u01b0\u1eddi c\u00f3 API key truy c\u1eadp th\u1eb3ng t\u00e0i kho\u1ea3n d\u1ecbch v\u1ee5, \u0111\u1ecdc ho\u1eb7c s\u1eeda d\u1eef li\u1ec7u; l\u1ed9 <a href=\"https:\/\/tino.vn\/blog\/cach-tao-api-key-trong-n8n\/\">API key c\u1ee7a n8n<\/a> th\u00ec h\u1ecd s\u1eeda \u0111\u01b0\u1ee3c c\u1ea3 workflow.<\/li>\n\n\n<li><strong>Chi ph\u00ed ph\u00e1t sinh:<\/strong> API key b\u1ecb l\u1ea1m d\u1ee5ng \u0111\u1ec3 g\u1eedi h\u00e0ng ngh\u00ecn request, \u0111\u1ea9y h\u00f3a \u0111\u01a1n cloud ho\u1eb7c AI t\u0103ng v\u1ecdt, ho\u1eb7c t\u00e0i kho\u1ea3n b\u1ecb kh\u00f3a v\u00ec v\u01b0\u1ee3t gi\u1edbi h\u1ea1n.<\/li>\n\n\n<li><strong>Lan sang h\u1ec7 th\u1ed1ng kh\u00e1c:<\/strong> workflow n\u1ed1i nhi\u1ec1u \u1ee9ng d\u1ee5ng, n\u00ean m\u1ed9t credential l\u1ed9 c\u00f3 th\u1ec3 l\u00e0 \u0111i\u1ec3m v\u00e0o to\u00e0n h\u1ec7 th\u1ed1ng.<\/li>\n\n\n<li><strong>Uy t\u00edn:<\/strong> s\u1ef1 c\u1ed1 r\u00f2 r\u1ec9 d\u1eef li\u1ec7u kh\u00e1ch h\u00e0ng lan nhanh v\u00e0 kh\u00f3 g\u1ee1.<\/li>\n<\/ul>\n\n\n\n<h3 id=\"\u1ea2nh_h\u01b0\u1edfng_\u0111\u1ebfn_d\u1eef_li\u1ec7u_doanh_nghi\u1ec7p\">\u1ea2nh h\u01b0\u1edfng \u0111\u1ebfn d\u1eef li\u1ec7u doanh nghi\u1ec7p<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>M\u1ea5t d\u1eef li\u1ec7u:<\/strong> d\u1eef li\u1ec7u kh\u00e1ch h\u00e0ng, b\u00e1o c\u00e1o, t\u00e0i ch\u00ednh b\u1ecb \u0111\u00e1nh c\u1eafp ho\u1eb7c x\u00f3a.<\/li>\n\n\n<li><strong>Gi\u00e1n \u0111o\u1ea1n:<\/strong> ph\u1ea3i thu h\u1ed3i key g\u1ea5p l\u00e0m workflow d\u1eebng, ch\u1eadm vi\u1ec7c v\u1eadn h\u00e0nh.<\/li>\n\n\n<li><strong>Chi ph\u00ed kh\u1eafc ph\u1ee5c:<\/strong> t\u1ed1n c\u00f4ng \u0111i\u1ec1u tra, kh\u00f4i ph\u1ee5c v\u00e0 t\u0103ng c\u01b0\u1eddng b\u1ea3o m\u1eadt sau s\u1ef1 c\u1ed1.<\/li>\n\n\n<li><strong>Ph\u00e1p l\u00fd:<\/strong> l\u1ed9 d\u1eef li\u1ec7u c\u00e1 nh\u00e2n c\u00f3 th\u1ec3 vi ph\u1ea1m quy \u0111\u1ecbnh b\u1ea3o v\u1ec7 d\u1eef li\u1ec7u nh\u01b0 <a href=\"https:\/\/gdpr-info.eu\/\" rel=\"nofollow noopener\" target=\"_blank\">GDPR<\/a> v\u00e0 lu\u1eadt Vi\u1ec7t Nam v\u1ec1 b\u1ea3o v\u1ec7 d\u1eef li\u1ec7u c\u00e1 nh\u00e2n.<\/li>\n<\/ul>\n\n\n\n<h2 id=\"n8n_l\u01b0u_v\u00e0_m\u00e3_h\u00f3a_credential_nh\u01b0_th\u1ebf_n\u00e0o?\">n8n l\u01b0u v\u00e0 m\u00e3 h\u00f3a credential nh\u01b0 th\u1ebf n\u00e0o?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">n8n l\u01b0u credential trong database (SQLite ho\u1eb7c PostgreSQL) \u1edf d\u1ea1ng \u0111\u00e3 m\u00e3 h\u00f3a. Kh\u00f3a m\u00e3 h\u00f3a \u0111\u01b0\u1ee3c t\u1ea1o ng\u1eabu nhi\u00ean \u1edf l\u1ea7n ch\u1ea1y \u0111\u1ea7u v\u00e0 ghi v\u00e0o file <code>config<\/code> trong th\u01b0 m\u1ee5c .n8n, tr\u1eeb khi b\u1ea1n \u0111\u1eb7t s\u1eb5n bi\u1ebfn <code>N8N_ENCRYPTION_KEY<\/code> (<a href=\"https:\/\/docs.n8n.io\/deploy\/host-n8n\/configure-n8n\/basic-configuration\/configuration-examples\/set-a-custom-encryption-key\" rel=\"nofollow noopener\" target=\"_blank\">Set a custom encryption key<\/a>). Kh\u00f4ng c\u00f3 file credential ri\u00eang n\u00e0o c\u1ea7n m\u00e3 h\u00f3a th\u00eam; th\u1ee9 c\u1ea7n gi\u1eef l\u00e0 database v\u00e0 kh\u00f3a.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1400\" height=\"750\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/bao-mat-credentials-va-api-keys-trong-n8n-khoa-ma-hoa.webp\" alt=\"C\u01a1 ch\u1ebf credential trong n8n: database SQLite ho\u1eb7c PostgreSQL ch\u1ec9 gi\u1eef b\u1ea3n \u0111\u00e3 m\u00e3 h\u00f3a, c\u1ed9ng kh\u00f3a instance N8N_ENCRYPTION_KEY ho\u1eb7c file config trong .n8n, m\u1edbi ra API key \u0111\u1ecdc \u0111\u01b0\u1ee3c l\u00fac node ch\u1ea1y; l\u1ed9 b\u1ea3n dump database ch\u01b0a \u0111\u1ee7 \u0111\u1ec3 \u0111\u1ecdc credential, m\u1ea5t kh\u00f3a th\u00ec ph\u1ea3i nh\u1eadp l\u1ea1i m\u1ecdi credential, \u0111\u1ed5i kh\u00f3a gi\u1eefa ch\u1eebng th\u00ec n8n kh\u00f4ng gi\u1ea3i m\u00e3 \u0111\u01b0\u1ee3c d\u1eef li\u1ec7u c\u0169\" class=\"wp-image-131720\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/bao-mat-credentials-va-api-keys-trong-n8n-khoa-ma-hoa.webp 1400w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/bao-mat-credentials-va-api-keys-trong-n8n-khoa-ma-hoa-300x161.webp 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/bao-mat-credentials-va-api-keys-trong-n8n-khoa-ma-hoa-1024x549.webp 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/bao-mat-credentials-va-api-keys-trong-n8n-khoa-ma-hoa-768x411.webp 768w\" sizes=\"(max-width: 1400px) 100vw, 1400px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>T\u00ecnh hu\u1ed1ng<\/th><th>H\u1eadu qu\u1ea3<\/th><th>C\u00e1ch tr\u00e1nh<\/th><\/tr><\/thead><tbody><tr><td>Kh\u00f4ng \u0111\u1eb7t kh\u00f3a, m\u1ea5t volume .n8n<\/td><td>Database c\u00f2n nh\u01b0ng credential kh\u00f4ng gi\u1ea3i m\u00e3 \u0111\u01b0\u1ee3c<\/td><td>Sao l\u01b0u file config ho\u1eb7c t\u1ef1 \u0111\u1eb7t N8N_ENCRYPTION_KEY v\u00e0 c\u1ea5t ri\u00eang<\/td><\/tr><tr><td>\u0110\u1ed5i N8N_ENCRYPTION_KEY sau khi \u0111\u00e3 l\u01b0u credential<\/td><td>Credential c\u0169 b\u00e1o l\u1ed7i gi\u1ea3i m\u00e3<\/td><td>\u0110\u1eb7t kh\u00f3a tr\u01b0\u1edbc l\u1ea7n ch\u1ea1y \u0111\u1ea7u v\u00e0 gi\u1eef nguy\u00ean<\/td><\/tr><tr><td>Queue mode, worker kh\u00e1c kh\u00f3a v\u1edbi main<\/td><td>Worker kh\u00f4ng \u0111\u1ecdc \u0111\u01b0\u1ee3c credential<\/td><td>M\u1ecdi main v\u00e0 worker d\u00f9ng chung m\u1ed9t kh\u00f3a<\/td><\/tr><tr><td>Kh\u00f3a n\u1eb1m chung th\u01b0 m\u1ee5c v\u1edbi b\u1ea3n backup<\/td><td>L\u1ed9 m\u1ed9t ch\u1ed7 l\u00e0 l\u1ed9 c\u1ea3 hai<\/td><td>C\u1ea5t kh\u00f3a trong tr\u00ecnh qu\u1ea3n l\u00fd m\u1eadt kh\u1ea9u<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">Kh\u00f3a m\u00e3 h\u00f3a v\u00e0 nh\u1eefng l\u1ed7i hay g\u1eb7p (docs.n8n.io, 23\/10\/2026)<\/figcaption><\/figure>\n\n\n\n<h2 id=\"5_c\u1ea5p_\u0111\u1ed9_b\u1ea3o_m\u1eadt_credentials_v\u00e0_API_key_trong_n8n\">5 c\u1ea5p \u0111\u1ed9 b\u1ea3o m\u1eadt credentials v\u00e0 API key trong n8n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">N\u0103m c\u1ea5p \u0111\u1ed9 d\u01b0\u1edbi \u0111i t\u1eeb vi\u1ec7c m\u1ecdi b\u1ea3n t\u1ef1 host \u0111\u1ec1u n\u00ean l\u00e0m \u0111\u1ebfn c\u00e1c l\u1edbp ch\u1ec9 c\u1ea7n cho \u0111\u1ed9i l\u1edbn: \u0111\u1eb7t b\u00ed m\u1eadt \u0111\u00fang ch\u1ed7, gi\u1eef kh\u00f3a m\u00e3 h\u00f3a, d\u00f9ng kho b\u00ed m\u1eadt ngo\u00e0i, ph\u00e2n quy\u1ec1n v\u00e0 xoay v\u00f2ng key.<\/p>\n\n\n\n<h3 id=\"C\u1ea5p_\u0111\u1ed9_1_(c\u01a1_b\u1ea3n):_L\u01b0u_API_key_trong_Credentials,_kh\u00f4ng_d\u00e1n_v\u00e0o_node\">C\u1ea5p \u0111\u1ed9 1 (c\u01a1 b\u1ea3n): L\u01b0u API key trong Credentials, kh\u00f4ng d\u00e1n v\u00e0o node<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">M\u1ecdi API key d\u00f9ng trong workflow n\u00ean n\u1eb1m trong m\u1ee5c Credentials c\u1ee7a n8n: ch\u1ecdn credential c\u00f3 s\u1eb5n c\u1ee7a node, ho\u1eb7c v\u1edbi node HTTP Request ch\u1ecdn Authentication l\u00e0 Generic Credential Type (Header Auth, Bearer Auth\u2026). T\u1eeb n8n 2.0, bi\u1ebfn <code>N8N_BLOCK_ENV_ACCESS_IN_NODE<\/code> m\u1eb7c \u0111\u1ecbnh l\u00e0 true n\u00ean bi\u1ec3u th\u1ee9c v\u00e0 Code node kh\u00f4ng \u0111\u1ecdc \u0111\u01b0\u1ee3c <code>$env<\/code> n\u1eefa (<a href=\"https:\/\/docs.n8n.io\/changelog\/v20-breaking-changes\" rel=\"nofollow noopener\" target=\"_blank\">v2.0 breaking changes<\/a>, <a href=\"https:\/\/docs.n8n.io\/deploy\/host-n8n\/configure-n8n\/basic-configuration\/use-environment-variables\/security\" rel=\"nofollow noopener\" target=\"_blank\">Security environment variables<\/a>).<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1400\" height=\"750\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/bao-mat-credentials-va-api-keys-trong-n8n-luu-bi-mat-o-dau.webp\" alt=\"B\u1ed1n n\u01a1i c\u00f3 th\u1ec3 c\u1ea5t API key trong n8n: n\u00ean d\u00f9ng Credentials c\u1ee7a node v\u00ec \u0111\u01b0\u1ee3c m\u00e3 h\u00f3a v\u00e0 kh\u00f4ng l\u1ed9 khi export; node HTTP Request d\u00f9ng Generic credential nh\u01b0 Header Auth, Bearer Auth; g\u00f3i Enterprise d\u00f9ng External secrets nh\u01b0 Vault, AWS, GCP, Azure, 1Password, Infisical qua $secrets; tr\u00e1nh bi\u1ebfn $env ho\u1eb7c d\u00e1n th\u1eb3ng v\u00e0o node\" class=\"wp-image-131721\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/bao-mat-credentials-va-api-keys-trong-n8n-luu-bi-mat-o-dau.webp 1400w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/bao-mat-credentials-va-api-keys-trong-n8n-luu-bi-mat-o-dau-300x161.webp 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/bao-mat-credentials-va-api-keys-trong-n8n-luu-bi-mat-o-dau-1024x549.webp 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/bao-mat-credentials-va-api-keys-trong-n8n-luu-bi-mat-o-dau-768x411.webp 768w\" sizes=\"(max-width: 1400px) 100vw, 1400px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">File <code>.env<\/code> v\u1eabn d\u00f9ng cho c\u1ea5u h\u00ecnh c\u1ee7a ch\u00ednh n8n (m\u1eadt kh\u1ea9u database, kh\u00f3a m\u00e3 h\u00f3a), kh\u00f4ng ph\u1ea3i n\u01a1i \u0111\u1ec3 API key c\u1ee7a workflow. Trong <code>compose.yaml<\/code>, khai b\u00e1o <code>env_file: .env<\/code> v\u00e0 gi\u1edbi h\u1ea1n quy\u1ec1n \u0111\u1ecdc file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># .env (c\u00f9ng th\u01b0 m\u1ee5c compose.yaml)\nN8N_ENCRYPTION_KEY=chuoi-ngau-nhien-dai-it-nhat-32-ky-tu\nDB_POSTGRESDB_PASSWORD=mat-khau-database\n\nchmod 600 .env<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Bi\u1ebfn c\u1ea5u h\u00ecnh c\u1ee7a n8n c\u00f2n nh\u1eadn h\u1eadu t\u1ed1 <code>_FILE<\/code> \u0111\u1ec3 \u0111\u1ecdc gi\u00e1 tr\u1ecb t\u1eeb m\u1ed9t file ri\u00eang, v\u00ed d\u1ee5 <code>DB_POSTGRESDB_PASSWORD_FILE<\/code> tr\u1ecf t\u1edbi Docker secret, gi\u00fap m\u1eadt kh\u1ea9u kh\u00f4ng n\u1eb1m trong bi\u1ebfn m\u00f4i tr\u01b0\u1eddng.<\/p>\n\n\n\n<h3 id=\"C\u1ea5p_\u0111\u1ed9_2_(n\u00e2ng_cao):_\u0110\u1eb7t_v\u00e0_gi\u1eef_kh\u00f3a_N8N_ENCRYPTION_KEY\">C\u1ea5p \u0111\u1ed9 2 (n\u00e2ng cao): \u0110\u1eb7t v\u00e0 gi\u1eef kh\u00f3a N8N_ENCRYPTION_KEY<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>T\u1ea1o chu\u1ed7i ng\u1eabu nhi\u00ean d\u00e0i, v\u00ed d\u1ee5 <code>openssl rand -hex 32<\/code>.<\/li>\n\n\n<li>Th\u00eam v\u00e0o <code>.env<\/code> <strong>tr\u01b0\u1edbc l\u1ea7n ch\u1ea1y \u0111\u1ea7u<\/strong>: <code>N8N_ENCRYPTION_KEY=...<\/code>. N\u1ebfu n8n \u0111\u00e3 ch\u1ea1y, kh\u00f3a \u0111ang d\u00f9ng n\u1eb1m trong file <code>config<\/code> c\u1ee7a .n8n; gi\u1eef nguy\u00ean kh\u00f3a \u0111\u00f3.<\/li>\n\n\n<li>Kh\u00f4ng \u0111\u1ed5i kh\u00f3a sau khi \u0111\u00e3 l\u01b0u credential: n8n s\u1ebd kh\u00f4ng gi\u1ea3i m\u00e3 \u0111\u01b0\u1ee3c d\u1eef li\u1ec7u c\u0169.<\/li>\n\n\n<li>C\u1ea5t kh\u00f3a trong tr\u00ecnh qu\u1ea3n l\u00fd m\u1eadt kh\u1ea9u, t\u00e1ch kh\u1ecfi b\u1ea3n sao l\u01b0u database.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Mu\u1ed1n thay kh\u00f3a \u0111\u1ecbnh k\u1ef3 m\u00e0 kh\u00f4ng \u0111\u1ee5ng kh\u00f3a g\u1ed1c, n8n c\u00f3 t\u00ednh n\u0103ng xoay kh\u00f3a d\u1eef li\u1ec7u (encryption key rotation) cho m\u1ecdi b\u1ea3n t\u1ef1 host: b\u1eadt m\u1eb7c \u0111\u1ecbnh t\u1eeb n8n 3.0, \u1edf 2.x b\u1eadt b\u1eb1ng bi\u1ebfn <code>N8N_ENV_FEAT_ENCRYPTION_KEY_ROTATION<\/code>, r\u1ed3i xoay \u1edf Settings > Data Encryption Keys. Sao l\u01b0u database tr\u01b0\u1edbc khi b\u1eadt v\u00e0 kh\u00f4ng h\u1ea1 phi\u00ean b\u1ea3n n8n sau \u0111\u00f3 (<a href=\"https:\/\/docs.n8n.io\/deploy\/host-n8n\/configure-n8n\/security\/rotate-encryption-keys\" rel=\"nofollow noopener\" target=\"_blank\">Rotate encryption keys<\/a>).<\/p>\n\n\n\n<h3 id=\"C\u1ea5p_\u0111\u1ed9_3_(doanh_nghi\u1ec7p):_D\u00f9ng_External_secrets_v\u1edbi_Vault_ho\u1eb7c_kho_b\u00ed_m\u1eadt_\u0111\u00e1m_m\u00e2y\">C\u1ea5p \u0111\u1ed9 3 (doanh nghi\u1ec7p): D\u00f9ng External secrets v\u1edbi Vault ho\u1eb7c kho b\u00ed m\u1eadt \u0111\u00e1m m\u00e2y<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">External secrets cho ph\u00e9p n8n \u0111\u1ecdc b\u00ed m\u1eadt t\u1eeb kho ngo\u00e0i thay v\u00ec l\u01b0u trong database: 1Password (Connect Server), AWS Secrets Manager, Azure Key Vault, GCP Secrets Manager, HashiCorp Vault v\u00e0 Infisical. T\u00ednh n\u0103ng n\u00e0y c\u1ea5u h\u00ecnh trong Settings > External Secrets v\u00e0 theo trang t\u00e0i li\u1ec7u ch\u1ec9 c\u00f3 \u1edf g\u00f3i Enterprise, c\u1ea3 n8n Cloud l\u1eabn t\u1ef1 host (<a href=\"https:\/\/docs.n8n.io\/administer\/manage-credentials\/use-external-secret-stores\" rel=\"nofollow noopener\" target=\"_blank\">Use external secret stores<\/a>).<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Th\u00eam kho \u1edf Settings > External Secrets > Add secrets vault, \u0111\u1eb7t t\u00ean kho v\u00e0 nh\u1eadp th\u00f4ng tin truy c\u1eadp.<\/li>\n\n\n<li>Trong \u00f4 credential, g\u1ecdi b\u00ed m\u1eadt b\u1eb1ng bi\u1ec3u th\u1ee9c <code>{{ $secrets.&lt;t\u00ean-kho&gt;.&lt;t\u00ean-b\u00ed-m\u1eadt&gt; }}<\/code>. Bi\u1ec3u th\u1ee9c n\u00e0y ch\u1ec9 ch\u1ea1y trong tr\u01b0\u1eddng c\u1ee7a credential.<\/li>\n\n\n<li>Bi\u1ebfn m\u00f4i tr\u01b0\u1eddng li\u00ean quan ch\u1ec9 l\u00e0 <code>N8N_EXTERNAL_SECRETS_UPDATE_INTERVAL<\/code>, <code>N8N_EXTERNAL_SECRETS_CONNECT_TIMEOUT<\/code>, <code>N8N_EXTERNAL_SECRETS_REFRESH_TIMEOUT<\/code> (<a href=\"https:\/\/docs.n8n.io\/deploy\/host-n8n\/configure-n8n\/basic-configuration\/use-environment-variables\/external-secrets\" rel=\"nofollow noopener\" target=\"_blank\">External secrets environment variables<\/a>). Kh\u00f4ng c\u00f3 bi\u1ebfn d\u1ea1ng N8N_CREDENTIALS_VAULT_URL.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">B\u1ea3n Community kh\u00f4ng c\u00f3 External secrets. V\u1edbi d\u1ef1 \u00e1n nh\u1ecf, Credentials \u0111\u01b0\u1ee3c m\u00e3 h\u00f3a c\u1ed9ng kh\u00f3a gi\u1eef c\u1ea9n th\u1eadn l\u00e0 \u0111\u1ee7.<\/p>\n\n\n\n<h3 id=\"C\u1ea5p_\u0111\u1ed9_4_(qu\u1ea3n_l\u00fd_truy_c\u1eadp):_Ph\u00e2n_quy\u1ec1n_user\">C\u1ea5p \u0111\u1ed9 4 (qu\u1ea3n l\u00fd truy c\u1eadp): Ph\u00e2n quy\u1ec1n user<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u00c1p d\u1ee5ng nguy\u00ean t\u1eafc quy\u1ec1n t\u1ed1i thi\u1ec3u: ch\u1ec9 ng\u01b0\u1eddi c\u1ea7n m\u1edbi \u0111\u01b0\u1ee3c d\u00f9ng credential. \u1ede b\u1ea3n Community, ch\u1ec9 Owner v\u00e0 ng\u01b0\u1eddi t\u1ea1o truy c\u1eadp \u0111\u01b0\u1ee3c m\u1ed9t credential, kh\u00f4ng chia s\u1ebb cho user kh\u00e1c (<a href=\"https:\/\/docs.n8n.io\/deploy\/host-n8n\/community-edition-features\" rel=\"nofollow noopener\" target=\"_blank\">Community edition features<\/a>). Owner xem v\u00e0 s\u1eeda \u0111\u01b0\u1ee3c m\u1ecdi credential, n\u00ean n8n khuy\u00ean Owner d\u00f9ng th\u00eam m\u1ed9t t\u00e0i kho\u1ea3n Member cho vi\u1ec7c h\u1eb1ng ng\u00e0y (<a href=\"https:\/\/docs.n8n.io\/administer\/manage-users-and-access\/understand-instance-roles\" rel=\"nofollow noopener\" target=\"_blank\">Understand instance roles<\/a>).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u1ede g\u00f3i tr\u1ea3 ph\u00ed, b\u1ea1n chia s\u1ebb credential cho user ho\u1eb7c project \u0111\u1ec3 h\u1ecd d\u00f9ng trong node m\u00e0 kh\u00f4ng xem \u0111\u01b0\u1ee3c gi\u00e1 tr\u1ecb. C\u00e1ch th\u00eam user, \u0111\u1ed5i vai tr\u00f2, b\u1eadt 2FA: <a href=\"https:\/\/tino.vn\/blog\/cach-them-xoa-va-phan-quyen-user-trong-n8n\/\">th\u00eam, x\u00f3a v\u00e0 ph\u00e2n quy\u1ec1n user trong n8n<\/a>.<\/p>\n\n\n\n<h3 id=\"C\u1ea5p_\u0111\u1ed9_5_(gi\u00e1m_s\u00e1t):_Ki\u1ec3m_tra_v\u00e0_xoay_v\u00f2ng_API_key_\u0111\u1ecbnh_k\u1ef3\">C\u1ea5p \u0111\u1ed9 5 (gi\u00e1m s\u00e1t): Ki\u1ec3m tra v\u00e0 xoay v\u00f2ng API key \u0111\u1ecbnh k\u1ef3<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Xoay v\u00f2ng key (t\u1ea1o key m\u1edbi, thay v\u00e0o credential, x\u00f3a key c\u0169) gi\u1ea3m thi\u1ec7t h\u1ea1i n\u1ebfu m\u1ed9t key b\u1ecb l\u1ed9 m\u00e0 b\u1ea1n kh\u00f4ng bi\u1ebft. Key ch\u1ec9 s\u1ed1ng 90 ng\u00e0y th\u00ec thi\u1ec7t h\u1ea1i \u00edt h\u01a1n nhi\u1ec1u so v\u1edbi key kh\u00f4ng bao gi\u1edd h\u1ebft h\u1ea1n.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>M\u1ed7i qu\u00fd r\u00e0 so\u00e1t danh s\u00e1ch Credentials, x\u00f3a credential kh\u00f4ng c\u00f2n workflow n\u00e0o d\u00f9ng.<\/li>\n\n\n<li>Xoay key cho d\u1ecbch v\u1ee5 quan tr\u1ecdng (thanh to\u00e1n, AWS, Google Cloud, AI).<\/li>\n\n\n<li>\u0110\u1eb7t Expiration cho API key c\u1ee7a ch\u00ednh n8n khi t\u1ea1o \u1edf Settings > n8n API; \u1edf g\u00f3i Enterprise, gi\u1edbi h\u1ea1n scope cho t\u1eebng key (<a href=\"https:\/\/docs.n8n.io\/connect\/n8n-api\/authentication\" rel=\"nofollow noopener\" target=\"_blank\">n8n API Authentication<\/a>).<\/li>\n\n\n<li>Ch\u1ea1y <code>n8n audit<\/code> \u0111\u1ec3 n8n t\u1ef1 li\u1ec7t k\u00ea r\u1ee7i ro nh\u01b0 credential kh\u00f4ng d\u00f9ng, node nguy hi\u1ec3m, webhook c\u00f4ng khai (<a href=\"https:\/\/docs.n8n.io\/deploy\/host-n8n\/configure-n8n\/use-the-command-line\" rel=\"nofollow noopener\" target=\"_blank\">Use the command line<\/a>).<\/li>\n<\/ul>\n\n\n\n<h2 id=\"Nh\u1eefng_nguy\u00ean_t\u1eafc_c\u1ea7n_nh\u1edb_khi_l\u00e0m_vi\u1ec7c_v\u1edbi_credential_trong_n8n\">Nh\u1eefng nguy\u00ean t\u1eafc c\u1ea7n nh\u1edb khi l\u00e0m vi\u1ec7c v\u1edbi credential trong n8n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">B\u1ea3o m\u1eadt credential l\u00e0 vi\u1ec7c l\u00e0m \u0111\u1ec1u \u0111\u1eb7n, kh\u00f4ng ph\u1ea3i l\u00e0m m\u1ed9t l\u1ea7n. Danh s\u00e1ch d\u01b0\u1edbi d\u00f9ng nh\u01b0 checklist \u0111\u1ecbnh k\u1ef3 cho m\u1ecdi d\u1ef1 \u00e1n n8n.<\/p>\n\n\n\n<h3 id=\"1._Kh\u00f4ng_hard-code_credential_trong_workflow\">1. Kh\u00f4ng hard-code credential trong workflow<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Hard-code l\u00e0 d\u00e1n th\u1eb3ng API key, m\u1eadt kh\u1ea9u, token v\u00e0o tr\u01b0\u1eddng c\u1ee7a node, v\u00ed d\u1ee5 \u00f4 Header c\u1ee7a HTTP Request. \u0110\u00e2y l\u00e0 l\u1ed7i c\u01a1 b\u1ea3n nh\u01b0ng nguy hi\u1ec3m:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ai xem \u0111\u01b0\u1ee3c workflow c\u0169ng th\u1ea5y v\u00e0 sao ch\u00e9p \u0111\u01b0\u1ee3c key.<\/li>\n\n\n<li>Khi export workflow \u0111\u1ec3 chia s\u1ebb ho\u1eb7c sao l\u01b0u, key \u0111i k\u00e8m \u1edf d\u1ea1ng ch\u1eef th\u01b0\u1eddng trong file JSON.<\/li>\n\n\n<li>Khi xoay key, b\u1ea1n ph\u1ea3i d\u00f2 s\u1eeda t\u1eebng node, d\u1ec5 s\u00f3t.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>C\u00e1ch l\u00e0m \u0111\u00fang:<\/strong> t\u1ea1o credential (ho\u1eb7c Generic credential cho HTTP Request) r\u1ed3i ch\u1ecdn n\u00f3 trong node. Workflow export ra ch\u1ec9 ch\u1ee9a t\u00ean v\u00e0 ID c\u1ee7a credential, kh\u00f4ng ch\u1ee9a gi\u00e1 tr\u1ecb.<\/p>\n\n\n\n<h3 id=\"2._\u0110\u1eb7t_l\u1ecbch_xoay_v\u00f2ng_API_key\">2. \u0110\u1eb7t l\u1ecbch xoay v\u00f2ng API key<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0110\u1eebng coi API key l\u00e0 v\u0129nh vi\u1ec5n. Ghi l\u1ecbch (v\u00ed d\u1ee5 m\u1ed7i 90 ng\u00e0y ho\u1eb7c 6 th\u00e1ng) \u0111\u1ec3 r\u00e0 so\u00e1t v\u00e0 xoay c\u00e1c key quan tr\u1ecdng, bi\u1ebfn vi\u1ec7c n\u00e0y th\u00e0nh quy tr\u00ecnh chu\u1ea9n c\u1ee7a nh\u00f3m.<\/p>\n\n\n\n<h3 id=\"3._C\u1ea5p_quy\u1ec1n_t\u1ed1i_thi\u1ec3u_tr\u01b0\u1edbc_khi_t\u1ea1o_credential\">3. C\u1ea5p quy\u1ec1n t\u1ed1i thi\u1ec3u tr\u01b0\u1edbc khi t\u1ea1o credential<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Tr\u01b0\u1edbc khi t\u1ea1o API key \u1edf AWS, <a href=\"https:\/\/cloud.google.com\/\" rel=\"nofollow noopener\" target=\"_blank\">Google Cloud<\/a> hay d\u1ecbch v\u1ee5 kh\u00e1c, h\u1ecfi: workflow n\u00e0y th\u1ef1c s\u1ef1 c\u1ea7n l\u00e0m g\u00ec?<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Kh\u00f4ng n\u00ean:<\/strong> t\u1ea1o key quy\u1ec1n admin cho ti\u1ec7n v\u00ec &#8220;bi\u1ebft \u0111\u00e2u sau n\u00e0y c\u1ea7n&#8221;.<\/li>\n\n\n<li><strong>N\u00ean:<\/strong> ch\u1ec9 c\u1ea5p quy\u1ec1n h\u1eb9p nh\u1ea5t. Workflow ch\u1ec9 \u0111\u1ecdc m\u1ed9t b\u1ea3ng th\u00ec t\u1ea1o user database ch\u1ec9 c\u00f3 quy\u1ec1n SELECT tr\u00ean b\u1ea3ng \u0111\u00f3; ch\u1ec9 g\u1eedi email th\u00ec key ch\u1ec9 c\u00f3 quy\u1ec1n g\u1eedi.<\/li>\n<\/ul>\n\n\n\n<h3 id=\"4._\u0110\u1eb7t_t\u00ean_credential_c\u00f3_quy_t\u1eafc\">4. \u0110\u1eb7t t\u00ean credential c\u00f3 quy t\u1eafc<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Khi s\u1ed1 credential t\u0103ng, t\u00ean nh\u01b0 &#8220;My Google API&#8221;, &#8220;Stripe Key&#8221;, &#8220;Test Credential&#8221; kh\u00f4ng cho bi\u1ebft g\u00ec. D\u00f9ng c\u1ea5u tr\u00fac [D\u1ecbch v\u1ee5]_[M\u1ee5c \u0111\u00edch]_[M\u00f4i tr\u01b0\u1eddng], v\u00ed d\u1ee5:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Stripe_PaymentProcessing_Production<\/li>\n\n\n<li>GoogleSheets_ReadOnly_SalesReports<\/li>\n\n\n<li>AWS_S3Upload_Development<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Nh\u00ecn t\u00ean l\u00e0 bi\u1ebft credential d\u00f9ng l\u00e0m g\u00ec, cho d\u1ef1 \u00e1n n\u00e0o v\u00e0 nh\u1ea1y c\u1ea3m \u0111\u1ebfn \u0111\u00e2u.<\/p>\n\n\n\n<h3 id=\"5._H\u1ea1n_ch\u1ebf_d\u00f9ng_chung_m\u1ed9t_credential_cho_nhi\u1ec1u_workflow\">5. H\u1ea1n ch\u1ebf d\u00f9ng chung m\u1ed9t credential cho nhi\u1ec1u workflow<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Coi m\u1ed7i workflow ho\u1eb7c nh\u00f3m ch\u1ee9c n\u0103ng l\u00e0 m\u1ed9t \u1ee9ng d\u1ee5ng ri\u00eang v\u1edbi credential ri\u00eang, k\u1ec3 c\u1ea3 khi c\u00f9ng k\u1ebft n\u1ed1i m\u1ed9t d\u1ecbch v\u1ee5. Khi workflow A b\u1ecb nghi c\u00f3 l\u1ed7 h\u1ed5ng, b\u1ea1n thu h\u1ed3i credential c\u1ee7a A m\u00e0 kh\u00f4ng l\u00e0m d\u1eebng B v\u00e0 C.<\/p>\n\n\n\n<h3 id=\"6._Ki\u1ec3m_tra_b\u1ea3o_m\u1eadt_\u0111\u1ecbnh_k\u1ef3\">6. Ki\u1ec3m tra b\u1ea3o m\u1eadt \u0111\u1ecbnh k\u1ef3<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">D\u00e0nh 30 ph\u00fat m\u1ed7i qu\u00fd \u0111\u1ec3 m\u1edf danh s\u00e1ch Credentials, x\u00f3a credential kh\u00f4ng d\u00f9ng, xem key n\u00e0o s\u1eafp h\u1ebft h\u1ea1n ho\u1eb7c \u0111\u1ebfn k\u1ef3 xoay, v\u00e0 r\u00e0 l\u1ea1i quy\u1ec1n c\u1ee7a t\u1eebng user.<\/p>\n\n\n\n<h3 id=\"7._Chia_s\u1ebb_credential_an_to\u00e0n_trong_nh\u00f3m\">7. Chia s\u1ebb credential an to\u00e0n trong nh\u00f3m<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Kh\u00f4ng g\u1eedi API key qua Slack, email hay chat.<\/li>\n\n\n<li>D\u00f9ng tr\u00ecnh qu\u1ea3n l\u00fd m\u1eadt kh\u1ea9u (Bitwarden, 1Password) \u0111\u1ec3 trao th\u00f4ng tin.<\/li>\n\n\n<li>\u1ede g\u00f3i n8n tr\u1ea3 ph\u00ed, chia s\u1ebb quy\u1ec1n d\u00f9ng credential ngay trong n8n m\u00e0 kh\u00f4ng l\u1ed9 gi\u00e1 tr\u1ecb.<\/li>\n<\/ul>\n\n\n\n<h3 id=\"8._T\u00e1ch_credential_gi\u1eefa_c\u00e1c_m\u00f4i_tr\u01b0\u1eddng\">8. T\u00e1ch credential gi\u1eefa c\u00e1c m\u00f4i tr\u01b0\u1eddng<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Credential c\u1ee7a m\u00f4i tr\u01b0\u1eddng ph\u00e1t tri\u1ec3n kh\u00f4ng \u0111\u01b0\u1ee3c d\u00f9ng cho m\u00f4i tr\u01b0\u1eddng th\u1eadt. M\u00f4i tr\u01b0\u1eddng dev th\u01b0\u1eddng \u00edt \u0111\u01b0\u1ee3c b\u1ea3o v\u1ec7, nhi\u1ec1u ng\u01b0\u1eddi truy c\u1eadp; d\u00f9ng chung key l\u00e0 m\u1edf \u0111\u01b0\u1eddng v\u00e0o h\u1ec7 th\u1ed1ng th\u1eadt. D\u00f9ng key ri\u00eang, v\u00ed d\u1ee5 Stripe test key cho dev v\u00e0 live key cho production.<\/p>\n\n\n\n<h3 id=\"9._B\u1eadt_c\u1ea3nh_b\u00e1o_khi_API_key_b\u1ecb_d\u00f9ng_b\u1ea5t_th\u01b0\u1eddng\">9. B\u1eadt c\u1ea3nh b\u00e1o khi API key b\u1ecb d\u00f9ng b\u1ea5t th\u01b0\u1eddng<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0110\u1eb7t c\u1ea3nh b\u00e1o ng\u00e2n s\u00e1ch tr\u00ean AWS Billing khi chi ph\u00ed t\u0103ng \u0111\u1ed9t ng\u1ed9t.<\/li>\n\n\n<li>\u0110\u1eb7t c\u1ea3nh b\u00e1o tr\u00ean Google Cloud khi API key \u0111\u01b0\u1ee3c g\u1ecdi t\u1eeb IP l\u1ea1.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u0110\u00e2y l\u00e0 l\u1edbp ph\u00f2ng th\u1ee7 ch\u1ee7 \u0111\u1ed9ng, gi\u00fap ph\u00e1t hi\u1ec7n s\u1ef1 c\u1ed1 s\u1edbm. Cu\u1ed1i c\u00f9ng, sao l\u01b0u credential c\u00f9ng kh\u00f3a theo h\u01b0\u1edbng d\u1eabn <a href=\"https:\/\/tino.vn\/blog\/cach-backup-va-restore-workflow-n8n\/\">backup v\u00e0 restore workflow, credential n8n<\/a>.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Mu\u1ed1n ch\u1ea1y n8n 24\/7 m\u00e0 kh\u00f4ng t\u1ef1 c\u00e0i? <a href=\"https:\/\/tino.vn\/vps-n8n\">VPS n8n c\u1ee7a Tino<\/a> c\u00e0i s\u1eb5n n8n tr\u00ean VPS NVMe \u0111\u1eb7t t\u1ea1i Vi\u1ec7t Nam; b\u1ea1n v\u1eabn c\u00f3 quy\u1ec1n root \u0111\u1ec3 c\u1ea5u h\u00ecnh. Xem c\u1ea5u h\u00ecnh v\u00e0 gi\u00e1 tr\u00ean trang s\u1ea3n ph\u1ea9m.<\/p>\n<\/blockquote>\n\n\n\n<h2 id=\"C\u00e2u_h\u1ecfi_th\u01b0\u1eddng_g\u1eb7p\">C\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p<\/h2>\n\n\n\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h2 id=\"L\u00e0m_c\u00e1ch_n\u00e0o_\u0111\u1ec3_backup_credentials_n8n?\">L\u00e0m c\u00e1ch n\u00e0o \u0111\u1ec3 backup credentials n8n?<\/h2>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p class=\"wp-block-paragraph\">Tr\u00ean b\u1ea3n t\u1ef1 host, ch\u1ea1y n8n export:credentials &#8211;backup (credential v\u1eabn m\u00e3 h\u00f3a) v\u00e0 sao l\u01b0u ri\u00eang kh\u00f3a m\u00e3 h\u00f3a trong file config c\u1ee7a .n8n ho\u1eb7c bi\u1ebfn N8N_ENCRYPTION_KEY. Thi\u1ebfu kh\u00f3a th\u00ec b\u1ea3n backup kh\u00f4ng kh\u00f4i ph\u1ee5c \u0111\u01b0\u1ee3c.<\/p>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h2 id=\"D\u1ef1_\u00e1n_c\u00e1_nh\u00e2n_nh\u1ecf_c\u00f3_c\u1ea7n_HashiCorp_Vault_kh\u00f4ng?\">D\u1ef1 \u00e1n c\u00e1 nh\u00e2n nh\u1ecf c\u00f3 c\u1ea7n HashiCorp Vault kh\u00f4ng?<\/h2>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p class=\"wp-block-paragraph\">Kh\u00f4ng c\u1ea7n. External secrets ch\u1ec9 c\u00f3 \u1edf g\u00f3i Enterprise. V\u1edbi d\u1ef1 \u00e1n nh\u1ecf, l\u01b0u key trong Credentials, \u0111\u1eb7t N8N_ENCRYPTION_KEY ri\u00eang v\u00e0 c\u1ea5t kh\u00f3a trong tr\u00ecnh qu\u1ea3n l\u00fd m\u1eadt kh\u1ea9u l\u00e0 \u0111\u1ee7.<\/p>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h2 id=\"X\u00e1c_th\u1ef1c_b\u1eb1ng_API_key_v\u00e0_OAuth2_trong_n8n_kh\u00e1c_nhau_th\u1ebf_n\u00e0o?\">X\u00e1c th\u1ef1c b\u1eb1ng API key v\u00e0 OAuth2 trong n8n kh\u00e1c nhau th\u1ebf n\u00e0o?<\/h2>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p class=\"wp-block-paragraph\">API key l\u00e0 chu\u1ed7i b\u00ed m\u1eadt c\u1ed1 \u0111\u1ecbnh b\u1ea1n t\u1ea1o \u1edf d\u1ecbch v\u1ee5 r\u1ed3i d\u00e1n v\u00e0o credential. OAuth2 chuy\u1ec3n b\u1ea1n t\u1edbi trang \u0111\u0103ng nh\u1eadp c\u1ee7a d\u1ecbch v\u1ee5 \u0111\u1ec3 c\u1ea5p quy\u1ec1n; n8n nh\u1eadn token c\u00f3 h\u1ea1n v\u00e0 t\u1ef1 l\u00e0m m\u1edbi, b\u1ea1n kh\u00f4ng \u0111\u01b0a m\u1eadt kh\u1ea9u cho n8n.<\/p>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h2 id=\"M\u1ed9t_credential_Google_c\u00f3_d\u00f9ng_chung_cho_Gmail,_Sheets,_Drive_\u0111\u01b0\u1ee3c_kh\u00f4ng?\">M\u1ed9t credential Google c\u00f3 d\u00f9ng chung cho Gmail, Sheets, Drive \u0111\u01b0\u1ee3c kh\u00f4ng?<\/h2>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p class=\"wp-block-paragraph\">Th\u01b0\u1eddng l\u00e0 kh\u00f4ng: m\u1ed7i node Google d\u00f9ng lo\u1ea1i credential ri\u00eang (Gmail OAuth2, Google Sheets OAuth2\u2026). B\u1ea1n c\u00f3 th\u1ec3 d\u00f9ng chung m\u1ed9t OAuth Client ID v\u00e0 Secret t\u1ea1o trong Google Cloud cho c\u00e1c credential \u0111\u00f3.<\/p>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h2 id=\"V\u00ec_sao_credential_ch\u1ea1y_\u0111\u01b0\u1ee3c_khi_test_nh\u01b0ng_l\u1ed7i_khi_workflow_ch\u1ea1y_th\u1eadt?\">V\u00ec sao credential ch\u1ea1y \u0111\u01b0\u1ee3c khi test nh\u01b0ng l\u1ed7i khi workflow ch\u1ea1y th\u1eadt?<\/h2>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p class=\"wp-block-paragraph\">Hay g\u1eb7p nh\u1ea5t l\u00e0 gi\u1edbi h\u1ea1n IP (key ch\u1ec9 cho ph\u00e9p IP nh\u1ea5t \u0111\u1ecbnh, kh\u00f4ng c\u00f3 IP c\u1ee7a m\u00e1y ch\u1ee7 n8n), key h\u1ebft h\u1ea1n ho\u1eb7c b\u1ecb thu h\u1ed3i, ho\u1eb7c thi\u1ebfu quy\u1ec1n. Xem chi ti\u1ebft l\u1ed7i trong execution c\u1ee7a workflow.<\/p>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\n<script type=\"application\/ld+json\">\n\t{\n\t\t\"@context\": \"https:\/\/schema.org\",\n\t\t\"@type\": \"FAQPage\",\n\t\t\"mainEntity\": [\n\t\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \"L\u00e0m c\u00e1ch n\u00e0o \u0111\u1ec3 backup credentials n8n?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>Tr\u00ean b\u1ea3n t\u1ef1 host, ch\u1ea1y n8n export:credentials --backup (credential v\u1eabn m\u00e3 h\u00f3a) v\u00e0 sao l\u01b0u ri\u00eang kh\u00f3a m\u00e3 h\u00f3a trong file config c\u1ee7a .n8n ho\u1eb7c bi\u1ebfn N8N_ENCRYPTION_KEY. Thi\u1ebfu kh\u00f3a th\u00ec b\u1ea3n backup kh\u00f4ng kh\u00f4i ph\u1ee5c \u0111\u01b0\u1ee3c.<\/p>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t,\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \"D\u1ef1 \u00e1n c\u00e1 nh\u00e2n nh\u1ecf c\u00f3 c\u1ea7n HashiCorp Vault kh\u00f4ng?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>Kh\u00f4ng c\u1ea7n. External secrets ch\u1ec9 c\u00f3 \u1edf g\u00f3i Enterprise. V\u1edbi d\u1ef1 \u00e1n nh\u1ecf, l\u01b0u key trong Credentials, \u0111\u1eb7t N8N_ENCRYPTION_KEY ri\u00eang v\u00e0 c\u1ea5t kh\u00f3a trong tr\u00ecnh qu\u1ea3n l\u00fd m\u1eadt kh\u1ea9u l\u00e0 \u0111\u1ee7.<\/p>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t,\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \"X\u00e1c th\u1ef1c b\u1eb1ng API key v\u00e0 OAuth2 trong n8n kh\u00e1c nhau th\u1ebf n\u00e0o?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>API key l\u00e0 chu\u1ed7i b\u00ed m\u1eadt c\u1ed1 \u0111\u1ecbnh b\u1ea1n t\u1ea1o \u1edf d\u1ecbch v\u1ee5 r\u1ed3i d\u00e1n v\u00e0o credential. OAuth2 chuy\u1ec3n b\u1ea1n t\u1edbi trang \u0111\u0103ng nh\u1eadp c\u1ee7a d\u1ecbch v\u1ee5 \u0111\u1ec3 c\u1ea5p quy\u1ec1n; n8n nh\u1eadn token c\u00f3 h\u1ea1n v\u00e0 t\u1ef1 l\u00e0m m\u1edbi, b\u1ea1n kh\u00f4ng \u0111\u01b0a m\u1eadt kh\u1ea9u cho n8n.<\/p>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t,\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \"M\u1ed9t credential Google c\u00f3 d\u00f9ng chung cho Gmail, Sheets, Drive \u0111\u01b0\u1ee3c kh\u00f4ng?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>Th\u01b0\u1eddng l\u00e0 kh\u00f4ng: m\u1ed7i node Google d\u00f9ng lo\u1ea1i credential ri\u00eang (Gmail OAuth2, Google Sheets OAuth2\u2026). B\u1ea1n c\u00f3 th\u1ec3 d\u00f9ng chung m\u1ed9t OAuth Client ID v\u00e0 Secret t\u1ea1o trong Google Cloud cho c\u00e1c credential \u0111\u00f3.<\/p>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t,\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \"V\u00ec sao credential ch\u1ea1y \u0111\u01b0\u1ee3c khi test nh\u01b0ng l\u1ed7i khi workflow ch\u1ea1y th\u1eadt?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>Hay g\u1eb7p nh\u1ea5t l\u00e0 gi\u1edbi h\u1ea1n IP (key ch\u1ec9 cho ph\u00e9p IP nh\u1ea5t \u0111\u1ecbnh, kh\u00f4ng c\u00f3 IP c\u1ee7a m\u00e1y ch\u1ee7 n8n), key h\u1ebft h\u1ea1n ho\u1eb7c b\u1ecb thu h\u1ed3i, ho\u1eb7c thi\u1ebfu quy\u1ec1n. Xem chi ti\u1ebft l\u1ed7i trong execution c\u1ee7a workflow.<\/p>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\t]\n\t}\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>n8n m\u00e3 h\u00f3a m\u1ecdi credential trong database b\u1eb1ng kh\u00f3a N8N_ENCRYPTION_KEY, n\u00ean vi\u1ec7c \u0111\u1ea7u ti\u00ean khi t\u1ef1 host l\u00e0 \u0111\u1eb7t kh\u00f3a ri\u00eang, sao l\u01b0u kh\u00f3a t\u00e1ch kh\u1ecfi m\u00e1y ch\u1ee7 v\u00e0 kh\u00f4ng d\u00e1n API key th\u1eb3ng v\u00e0o node. Sau \u0111\u00f3 gi\u1edbi h\u1ea1n ai \u0111\u01b0\u1ee3c xem credential, b\u1eadt 2FA v\u00e0 xoay v\u00f2ng key \u0111\u1ecbnh k\u1ef3. Kho b\u00ed m\u1eadt [&hellip;]<\/p>\n","protected":false},"author":23,"featured_media":119503,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7397],"tags":[7343],"class_list":["post-119497","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-n8n","tag-n8n"],"_links":{"self":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/posts\/119497","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/users\/23"}],"replies":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/comments?post=119497"}],"version-history":[{"count":2,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/posts\/119497\/revisions"}],"predecessor-version":[{"id":131866,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/posts\/119497\/revisions\/131866"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/media\/119503"}],"wp:attachment":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/media?parent=119497"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/categories?post=119497"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/tags?post=119497"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}