Loading...
Loading...
Use when handling any auth, API keys, tokens, OAuth, bearer tokens, basic auth, or secret values in n8n workflows. Triggers on "API key", "token", "bearer", "OAuth", "secret", "auth", "credentials", "Authorization header", "x-api-key", or any node configuration that mentions a third-party service.
npx skill4agent add n8n-io/skills n8n-credentials-and-securitynewCredential()credentials{{$json.token}}newCredential('Label')'Gmail''OpenRouter''Acme API'httpCustomAuthreferences/CUSTOM_CREDENTIALS.mdcredentialsreferences/CREDENTIAL_SYSTEM.mdNeed to call an external service?
├── Native credential exists (Slack, Gmail, OpenAI, Postgres, ...)?
│ └── Use the native node + its credential type. Done.
│
├── Service is "standard-shaped" (REST + Bearer/Basic/OAuth)?
│ ├── Configure HTTP Request with one of the built-in auth types:
│ │ - Generic OAuth2
│ │ - Header Auth
| | - Bearer Auth (same as header auth but with only field being for actual token)
│ │ - Basic Auth
│ │ - Custom Auth
│ └── See references/HTTP_REQUEST_WITH_AUTH.md
│
└── Service needs multiple static headers, or headers plus query params?
└── Use the httpCustomAuth credential type.
See references/CUSTOM_CREDENTIALS.md"Set up a workflow to call Acme API with bearer"sk-abc123def456
{{$json.token}}Bearer AuthHeader Authn8n-extending-mcpreferences/FINDING_API_DOCS.mdreferences/HTTP_REQUEST_WITH_AUTH.mdreferences/CUSTOM_CREDENTIALS.md| File | Read when |
|---|---|
| You need to understand how credentials are stored, referenced, scoped, or rotated |
| Multi-header / header-plus-query auth in one credential, or per-request signing patterns (HMAC, JWT, webhook validation) |
| Configuring HTTP Request with auth: Bearer, Basic, OAuth, Header Auth |
| The user mentioned a service you don't have node-level knowledge of |
| Anti-pattern | What goes wrong | Fix |
|---|---|---|
Pasting | Token in plain text in the workflow JSON, leaks on export, copy, screenshot | Use a credential: |
| Storing token in a Set node and referencing via expression | Same problem, value lives in workflow JSON | Same fix: credential, not a Set node |
| Using HTTP Request when a native node exists | Loses auto-refresh on OAuth, loses native error handling, more code | Use the native node |
Hardcoding credentials in SDK code ( | Same leak surface | Use |
| Asking the user to create a credential without naming the credential type | User picks the wrong type, auth fails confusingly | Always specify: "create a credential of type |