{"record":{"id":"f2842ae8110b63ab","repo":"n8n-io/n8n","slug":"authorization-data-is-wrong","errorCode":null,"errorMessage":"Authorization data is wrong!","messagePattern":"Authorization data is wrong!","errorType":"exception","errorClass":"ChatTriggerAuthorizationError","httpStatus":403,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/trigger/ChatTrigger/GenericFunctions.ts","lineNumber":35,"sourceCode":"\t} else if (authentication === 'basicAuth') {\n\t\t// Basic authorization is needed to call webhook\n\t\tlet expectedAuth: ICredentialDataDecryptedObject | undefined;\n\t\ttry {\n\t\t\texpectedAuth = await context.getCredentials<ICredentialDataDecryptedObject>('httpBasicAuth');\n\t\t} catch {}\n\n\t\tif (expectedAuth === undefined || !expectedAuth.user || !expectedAuth.password) {\n\t\t\t// Data is not defined on node so can not authenticate\n\t\t\tthrow new ChatTriggerAuthorizationError(500, 'No authentication data defined on node!');\n\t\t}\n\n\t\tconst providedAuth = basicAuth(req);\n\t\t// Authorization data is missing\n\t\tif (!providedAuth) throw new ChatTriggerAuthorizationError(401);\n\n\t\tif (providedAuth.name !== expectedAuth.user || providedAuth.pass !== expectedAuth.password) {\n\t\t\t// Provided authentication data is wrong\n\t\t\tthrow new ChatTriggerAuthorizationError(403);\n\t\t}\n\t} else if (authentication === 'n8nUserAuth') {\n\t\tconst webhookName = context.getWebhookName();\n\n\t\tif (webhookName !== 'setup') {\n\t\t\tfunction getCookie(name: string) {\n\t\t\t\tconst value = `; ${headers.cookie}`;\n\t\t\t\tconst parts = value.split(`; ${name}=`);\n\n\t\t\t\tif (parts.length === 2) {\n\t\t\t\t\treturn parts.pop()?.split(';').shift();\n\t\t\t\t}\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\tconst authCookie = getCookie('n8n-auth');\n\t\t\tif (!authCookie) {\n\t\t\t\tthrow new ChatTriggerAuthorizationError(401, 'User not authenticated!');","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/trigger/ChatTrigger/GenericFunctions.ts#L17-L53","documentation":"The Chat Trigger uses Basic Auth, the request supplied Basic credentials, but the provided username/password do not match the ones stored in the node's httpBasicAuth credential. The node throws ChatTriggerAuthorizationError(403) — credentials are present but wrong.","triggerScenarios":"providedAuth.name !== expectedAuth.user OR providedAuth.pass !== expectedAuth.password, where providedAuth comes from parsing the request's Authorization header and expectedAuth from the httpBasicAuth credential.","commonSituations":"Typo in the username/password the caller sends; the password was rotated in the credential but the client still uses the old one; the caller copied credentials from a different Chat Trigger instance.","solutions":["Verify the username and password the client sends exactly match the httpBasicAuth credential bound to the node.","If the credential was changed, update the client with the new values.","Re-open the node to confirm which httpBasicAuth credential is actually selected."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Ensure the caller's credentials match the node's expected values before sending.\nif (callerUser !== expectedUser || callerPass !== expectedPass) {\n  throw new Error('Credentials do not match the Chat Trigger httpBasicAuth credential.');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the httpBasicAuth credential and the client configuration in sync (e.g. share via a secret store).","When rotating the password, update both the credential and all clients in one change."],"tags":["authentication","http","webhook","chat-trigger","forbidden"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}