Cybereason API Login not working w/ HTTP Node

Describe the issue/error/question

We are tring to get the HTTP node to make a HTTP/POST to The Cybereason API, but the page only returns a 401. I have Cybereason support engaged and they me wanted to start an issue here and see if there is any advice yall can provide. Thanks in advance!

EDIT: Here is the API Login doc https://transfer.infosec-ops.com/spg/Log%20in%20with%20the%20API%20_%20The%20Nest.pdf

Example CURL tht works:

curl -X POST https://[hostname]:[port]/login.html -d "username=<username>&password=<my password>" --header "Content-Type:application/x-www-form-urlencoded" -c cookie.txt

What is the error message (if any)?

Just an HTTP 401 Returned, if I mirror the request in postman it works

Please share the workflow

Share the output returned by the last node

{
  "message": "401 - \"\"",
  "name": "Error",
  "stack": "Error: Request failed with status code 401\n    at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12)\n    at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:269:11)\n    at IncomingMessage.emit (node:events:539:35)\n    at endReadableNT (node:internal/streams/readable:1345:12)\n    at processTicksAndRejections (node:internal/process/task_queues:83:21)"
}

Information on your n8n setup

  • n8n version: 0.182.0
  • Database you’re using (default: SQLite): MySQL (AWS RDS)
  • Running n8n with the execution process [own(default), main]: (Own)
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: Kubernetes - Containerd

Hi @mwatermolen, it looks like your curl command sends a cookie in addition to the x-www-form-urlencoded data.

You could send a cookie in n8n by adding the respective Cookie header to your request.

Howdy @MutedJam! So I dont think that cookie is needed for the login, I beleve that was a typo as it works w/o the cookie in postman