n8n-io/n8n · error · ChatTriggerAuthorizationError
User not authenticated!
Error message
User not authenticated!
What it means
The Chat Trigger is configured for 'n8n User Auth' and this is not the setup webhook, but the incoming request carries no 'n8n-auth' cookie. The node requires the caller to be logged into n8n (the cookie is the n8n session token).
Source
Thrown at packages/@n8n/nodes-langchain/nodes/trigger/ChatTrigger/GenericFunctions.ts:53
throw new ChatTriggerAuthorizationError(403);
}
} else if (authentication === 'n8nUserAuth') {
const webhookName = context.getWebhookName();
if (webhookName !== 'setup') {
function getCookie(name: string) {
const value = `; ${headers.cookie}`;
const parts = value.split(`; ${name}=`);
if (parts.length === 2) {
return parts.pop()?.split(';').shift();
}
return '';
}
const authCookie = getCookie('n8n-auth');
if (!authCookie) {
throw new ChatTriggerAuthorizationError(401, 'User not authenticated!');
}
try {
await context.validateCookieAuth(authCookie);
} catch {
throw new ChatTriggerAuthorizationError(401, 'Invalid authentication token');
}
}
}
return;
}
View on GitHub (pinned to 5ac6606e81)
Solutions
- Log into the n8n instance in the same browser session before opening the chat URL.
- Ensure the chat widget is served from the same origin as n8n so the n8n-auth cookie is sent.
- If cookies are blocked, relax third-party cookie rules for the n8n origin or embed the chat within the authenticated n8n UI.
Defensive patterns
Strategy: validation
Validate before calling
// Browser-side: only open the chat URL after confirming an n8n-auth cookie exists.
if (!document.cookie.split('; ').some(c => c.startsWith('n8n-auth='))) {
window.location.href = '/signin'; // redirect to n8n login
} Prevention
- Embed the chat inside the authenticated n8n UI rather than on a third-party origin.
- Instruct users to log into n8n in the same browser before opening the chat URL.
- Avoid incognito/private mode for n8n-user-auth chat sessions.
When it happens
Trigger: authentication === 'n8nUserAuth', getWebhookName() !== 'setup', and getCookie('n8n-auth') from headers.cookie returns an empty/falsy value.
Common situations: Opening the chat URL in an incognito/private window or a different browser where the user is not logged into n8n; the session cookie expired; the chat is loaded in an iframe on a different origin that does not send the cookie; third-party cookie blocking.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
Related errors
- Invalid authentication token
- No authentication data defined on node!
- Authorization is required!
- Authorization data is wrong!
- Default webhook url not set
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/7d46859ea83a8077.
Report an issue: GitHub.