管理与治理
Credential overwrites
Credential overwrites let you set credential data globally. This data isn't visible to users, but n8n uses it automatically in the background - for example, to enable OAuth login using a "Connect" button without exposing client secrets.
In the Editor UI, n8n hides all overwritten fields by default, so users can authenticate with OAuth using the "Connect" button on the credential.
For the environment variables used to configure credential overwrites, refer to Credentials environment variables.
Using environment variables
Set CREDENTIALS_OVERWRITE_DATA to { CREDENTIAL_NAME: { PARAMETER: VALUE }}.
Using the REST API
The recommended approach is to load the data using a custom REST endpoint.
- Set
CREDENTIALS_OVERWRITE_ENDPOINTto the path where the endpoint should be available:
export CREDENTIALS_OVERWRITE_ENDPOINT=send-credentialsOptionally, set CREDENTIALS_OVERWRITE_ENDPOINT_AUTH_TOKEN to require a bearer token for accessing the endpoint.
Without an auth token, the endpoint can only be called once for security reasons.
- Prepare a JSON file with the credentials to overwrite. For example,
oauth-credentials.jsonfor Asana and GitHub:
{
"asanaOAuth2Api": {
"clientId": "<id>",
"clientSecret": "<secret>"
},
"githubOAuth2Api": {
"clientId": "<id>",
"clientSecret": "<secret>"
}
}- Send the file to your n8n instance:
curl -H "Content-Type: application/json" --data @oauth-credentials.json http://localhost:5678/send-credentialsIf CREDENTIALS_OVERWRITE_ENDPOINT_AUTH_TOKEN is set to secure-token:
curl -H "Content-Type: application/json" -H "Authorization: Bearer secure-token" --data @oauth-credentials.json http://localhost:5678/send-credentialsPersistence
To store credential overwrites in the database and propagate them to all workers in multi-instance or queue mode, enable:
export CREDENTIALS_OVERWRITE_PERSISTENCE=trueWhen enabled, n8n stores the encrypted overwrites in the settings table and broadcasts a reload-overwrite-credentials event so workers reload the latest values. When disabled, overwrites remain in memory on the process that loaded them and n8n doesn't propagate them to workers or preserve them across restarts.
官方原文和授权
本页来自 N8N 英文官方网站固定快照,并转换成 xueai 静态页面。内容以 N8N 持续更新的官方页面为准。