its just this one node, we try to get aoth2 running, then improve it with a custom token_exchange to allow impersonation.
console log with debug:
2022-11-08T14:30:38.839Z | debug | Request proxied to Axios failed "{\n error: Error: Request failed with status code 401\n at createError (C:\\Users\\username\\AppData\\Roaming\\npm\\node_modules\\n8n\\node_modules\\axios\\lib\\core\\createError.js:16:15)\n at settle (C:\\Users\\username\\AppData\\Roaming\\npm\\node_modules\\n8n\\node_modules\\axios\\lib\\core\\settle.js:17:12)\n at IncomingMessage.handleStreamEnd (C:\\Users\\username\\AppData\\Roaming\\npm\\node_modules\\n8n\\node_modules\\axios\\lib\\adapters\\http.js:269:11)\n at IncomingMessage.emit (node:events:532:35)\n at endReadableNT (node:internal/streams/readable:1346:12)\n at processTicksAndRejections (node:internal/process/task_queues:83:21) {\n config: {\n url: 'https://app.localdomain:5000/api/v1/employees',\n method: 'get',\n headers: [Object],\n transformRequest: [Array],\n transformResponse: [Function (anonymous)],\n paramsSerializer: [Function (anonymous)],\n timeout: 3600000,\n adapter: [Function: httpAdapter],\n responseType: 'arraybuffer',\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n maxContentLength: Infinity,\n maxBodyLength: Infinity,\n httpsAgent: [Agent],\n validateStatus: [Function: validateStatus],\n transitional: [Object],\n 'axios-retry': [Object],\n data: undefined\n
},\n request: ClientRequest {\n _events: [Object: null prototype],\n _eventsCount: 7,\n _maxListeners: undefined,\n outputData: [],\n outputSize: 0,\n writable: true,\n destroyed: false,\n _last: true,\n chunkedEncoding: false,\n shouldKeepAlive: false,\n maxRequestsOnConnectionReached: false,\n _defaultKeepAlive: true,\n useChunkedEncodingByDefault: false,\n sendDate: false,\n _removedConnection: false,\n _removedContLen: false,\n _removedTE: false,\n _contentLength: 0,\n _hasBody: true,\n _trailer: '',\n finished: true,\n _headerSent: true,\n _closed: false,\n socket: [TLSSocket],\n _header: 'GET /api/v1/employees HTTP/1.1\\r\\n' +\n 'Accept: application/json,text/html,application/xhtml+xml,application/xml,text/*;q=0.9, image/*;q=0.8, */*;q=0.7\\r\\n' +\n 'Authorization: Bearer xh5dhOPOiw5SX7F7vfN2YbDrPe186WieckQ3X8gBIZ\\r\\n' +\n 'User-Agent: axios/0.21.4\\r\\n' +\n 'Host: app.localdomain:5000\\r\\n' +\n 'Connection: close\\r\\n' +\n '\\r\\n',\n _keepAliveTimeout: 0,\n _onPendingData: [Function: nop],\n agent: [Agent],\n socketPath: undefined,\n method: 'GET',\n maxHeaderSize: undefined,\n insecureHTTPParser: undefined,\n path: '/api/v1/employees',\n _ended: true,\n res: [IncomingMessage],\n aborted: false,\n timeoutCb: null,\n upgradeOrConnect: false,\n parser: null,\n maxHeadersCount: null,\n reusedSocket: false,\n host: 'app.localdomain',\n protocol: 'https:',\n _redirectable: [Writable],\n [Symbol(kCapture)]: false,\n [Symbol(kNeedDrain)]: false,\n [Symbol(corked)]: 0,\n [Symbol(kOutHeaders)]: [Object: null prototype]\n },\n response: {\n status: 401,\n statusText: 'UNAUTHORIZED',\n
headers: [Object],\n config: [Object],\n request: [ClientRequest],\n data: <Buffer 7b 22 6d 65 73 73 61 67 65 22 3a 20 6e 75 6c 6c 7d 0a>\n },\n isAxiosError: true,\n toJSON: [Function: toJSON]\n },\n file: 'NodeExecuteFunctions.js'\n}"
2022-11-08T14:30:38.846Z | debug | OAuth2 token for "oAuth2Api" used by node "HTTP Request" expired. Should revalidate. "{ file: 'NodeExecuteFunctions.js' }"
2022-11-08T14:30:39.031Z | debug | Running node "HTTP Request" finished with error "{ node: 'HTTP Request', workflowId: '1', file: 'WorkflowExecute.js' }"
2022-11-08T14:30:39.036Z | debug | Received child process message of type processHook for execution ID 42. "{ executionId: '42', file: 'WorkflowRunner.js' }"
2022-11-08T14:30:39.038Z | debug | Executing hook on node "HTTP Request" (hookFunctionsPush) "{\n executionId: '42',\n sessionId: '68nmvpzta3',\n workflowId: '1',\n file: 'WorkflowExecuteAdditionalData.js',\n function: 'nodeExecuteAfter'\n}"
2022-11-08T14:30:39.039Z | debug | Send data of type "nodeExecuteAfter" to editor-UI "{\n dataType: 'nodeExecuteAfter',\n sessionId: '68nmvpzta3',\n file: 'Push.js',\n function: 'send'\n}"
2022-11-08T14:30:39.037Z | verbose | Workflow execution finished with error "{\n error: {\n context: {},\n name: 'NodeApiError',\n cause: {\n status: 'rejected',\n reason: ConnectionError: Unable to connect to app.localdomain:5000\n at TLSSocket.onError (C:\\Users\\username\\AppData\\Roaming\\npm\\node_modules\\n8n\\node_modules\\popsicle-transport-http\\src\\index.ts:973:13)\n at Object.onceWrapper (node:events:640:26)\n
at TLSSocket.emit (node:events:532:35)\n at emitErrorNT (node:internal/streams/destroy:157:8)\n at emitErrorCloseNT (node:internal/streams/destroy:122:3)\n at processTicksAndRejections (node:internal/process/task_queues:83:21) {\n request: Request {\n '$rawBody': 'grant_type=client_credentials&scope=profile',\n url: 'https://app.localdomain:5000/api/v1/oauth/token',\n method: 'POST',\n signal: Signal { _: [], '$': [Object: null prototype], aborted: false },\n headers: Headers { object: [Object: null prototype] },\n trailer: Promise { [Headers] }\n },\n code: 'EUNAVAILABLE',\n [cause]: Error: self signed certificate\n at TLSSocket.onConnectSecure (node:_tls_wrap:1530:34)\n at TLSSocket.emit (node:events:520:28)\n at TLSSocket._finishInit (node:_tls_wrap:944:8)\n at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:725:12) {\n code: 'DEPTH_ZERO_SELF_SIGNED_CERT'\n }\n }\n \n The following exception was the direct cause of the above exception:\n \n Error: self signed certificate\n at TLSSocket.onConnectSecure (node:_tls_wrap:1530:34)\n at TLSSocket.emit (node:events:520:28)\n at TLSSocket._finishInit (node:_tls_wrap:944:8)\n at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:725:12) {\n code: 'DEPTH_ZERO_SELF_SIGNED_CERT'\n }\n },\n timestamp: 1667917838937,\n node: {\n parameters: [Object],\n id: '6f78cef7-19d8-4905-953b-76fd65d69578',\n name: 'HTTP Request',\n type: 'n8n-nodes-base.httpRequest',\n
typeVersion: 3,\n position: [Array],\n credentials: [Object]\n },\n httpCode: 'rejected',\n message: 'UNKNOWN ERROR - check the detailed error for more information',\n description: 'self signed certificate',\n stack: 'NodeApiError: UNKNOWN ERROR - check the detailed error for more information\\n' +\n ' at Object.execute (C:\\\\Users\\\\username\\\\AppData\\\\Roaming\\\\npm\\\\node_modules\\\\n8n\\\\node_modules\\\\n8n-nodes-base\\\\nodes\\\\HttpRequest\\\\V3\\\\HttpRequestV3.node.ts:1194:12)\\n' +\n ' at processTicksAndRejections (node:internal/process/task_queues:96:5)\\n' +\n ' at Workflow.runNode (C:\\\\Users\\\\username\\\\AppData\\\\Roaming\\\\npm\\\\node_modules\\\\n8n\\\\node_modules\\\\n8n-workflow\\\\src\\\\Workflow.ts:1255:19)\\n' +\n ' at C:\\\\Users\\\\username\\\\AppData\\\\Roaming\\\\npm\\\\node_modules\\\\n8n\\\\node_modules\\\\n8n-core\\\\src\\\\WorkflowExecute.ts:938:29'\n },\n workflowId: '1',\n file: 'WorkflowExecute.js',\n function: 'processSuccessExecution'\n}"
2022-11-08T14:30:39.062Z | debug | Received child process message of type processHook for execution ID 42. "{ executionId: '42', file: 'WorkflowRunner.js' }"
2022-11-08T14:30:39.064Z | debug | Executing hook (hookFunctionsSave) "{\n executionId: '42',\n workflowId: '1',\n file: 'WorkflowExecuteAdditionalData.js',\n function: 'workflowExecuteAfter'\n}"
2022-11-08T14:30:39.066Z | debug | Received child process message of type end for execution ID 42. "{ executionId: '42', file: 'WorkflowRunner.js' }"
2022-11-08T14:30:39.070Z [Rudder] debug: no existing flush timer, creating new one
2022-11-08T14:30:39.079Z | debug | Executing hook (hookFunctionsPush) "{\n executionId: '42',\n sessionId: '68nmvpzta3',\n workflowId: '1',\n file: 'WorkflowExecuteAdditionalData.js',\n function: 'workflowExecuteAfter'\n}"
2022-11-08T14:30:39.082Z | debug | Save execution progress to database for execution ID 42 "{\n executionId: '42',\n workflowId: '1',\n file: 'WorkflowExecuteAdditionalData.js',\n function: 'workflowExecuteAfter'\n}"
2022-11-08T14:30:39.084Z | debug | Send data of type "executionFinished" to editor-UI "{\n dataType: 'executionFinished',\n sessionId: '68nmvpzta3',\n file: 'Push.js',\n function: 'send'\n}"
2022-11-08T14:30:59.074Z [Rudder] debug: in flush
2022-11-08T14:30:59.074Z [Rudder] debug: cancelling existing flushTimer...
2022-11-08T14:30:59.075Z [Rudder] debug: batch size is 2
2022-11-08T14:31:19.255Z [Rudder] debug: in flush
2022-11-08T14:31:19.255Z [Rudder] debug: cancelling existing timer...
2022-11-08T14:31:19.256Z [Rudder] debug: queue is empty, nothing to flush
2022-11-08T14:31:24.098Z | debug | Wait tracker querying database for waiting executions "{ file: 'WaitTracker.js', function: 'getWaitingExecutions' }"