{"record":{"id":"26709a828534dec1","repo":"n8n-io/n8n","slug":"no-authentication-data-defined-on-node","errorCode":null,"errorMessage":"No authentication data defined on node!","messagePattern":"No authentication data defined on node!","errorType":"exception","errorClass":"ChatTriggerAuthorizationError","httpStatus":500,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/trigger/ChatTrigger/GenericFunctions.ts","lineNumber":26,"sourceCode":"\tconst authentication = context.getNodeParameter(\n\t\t'authentication',\n\t\t'none',\n\t) as AuthenticationChatOption;\n\tconst req = context.getRequestObject();\n\tconst headers = context.getHeaderData();\n\n\tif (authentication === 'none') {\n\t\treturn;\n\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","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/trigger/ChatTrigger/GenericFunctions.ts#L8-L44","documentation":"Thrown by the Chat Trigger webhook when the node's authentication is set to 'basicAuth' but no 'httpBasicAuth' credential is attached (or its user/password fields are empty). It is a ChatTriggerAuthorizationError (extends UserError) with HTTP status 500 because the fault is the node's server-side configuration, not the caller's request.","triggerScenarios":"context.getNodeParameter('authentication') === 'basicAuth' AND getCredentials('httpBasicAuth') resolves to undefined (no credential bound) OR the resolved credential object has a falsy 'user' or 'password' field.","commonSituations":"Developer toggled the Chat Trigger's Authentication to 'Basic Auth' in the UI but forgot to select/create the httpBasicAuth credential; the credential is selected but the user or password field was left blank; a workflow imported from JSON is missing the credential reference.","solutions":["Open the Chat Trigger node, set Authentication to 'Basic Auth', and select (or create) an httpBasicAuth credential with non-empty user and password.","If you do not need auth, set the node's Authentication parameter back to 'None'.","If importing a workflow JSON, ensure the node's credentials array includes a valid httpBasicAuth reference."],"exampleFix":"// before: authentication='basicAuth' but no credential attached\n// after: node credentials include { name: 'httpBasicAuth', credentials: { user: 'admin', password: 's3cret' } }","handlingStrategy":"validation","validationCode":"// Before relying on validateAuth, ensure a complete httpBasicAuth credential is bound.\nconst cred = await context.getCredentials('httpBasicAuth').catch(() => undefined);\nif (!cred || !cred.user || !cred.password) {\n  throw new Error('Attach an httpBasicAuth credential with user and password before enabling Basic Auth.');\n}","typeGuard":"function hasBasicAuthFields(c: unknown): c is { user: string; password: string } {\n  return typeof c === 'object' && c !== null &&\n    typeof (c as any).user === 'string' && (c as any).user !== '' &&\n    typeof (c as any).password === 'string' && (c as any).password !== '';\n}","tryCatchPattern":"try {\n  await validateAuth(context);\n} catch (e) {\n  if (e instanceof ChatTriggerAuthorizationError && e.responseCode === 500) {\n    // surface a 'fix the node credential' message to the builder\n  }\n}","preventionTips":["When building a Chat Trigger template that uses Basic Auth, always bind an httpBasicAuth credential in the same workflow.","Add a pre-publish checklist item: verify every auth-enabled Chat Trigger has a selected credential with non-empty user/password."],"tags":["authentication","configuration","chat-trigger","webhook","credentials"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}