I’m having trouble authenticating to a REST API (S-MAX). In an initial request, I retrieve a token via HTTP post. This token must now be sent as a cookie in the format SMAX_AUTH_TOKEN=abcdefg.. for the actual API query. This works in Postman, but I get a 401 error in n8n. I’ve implemented the instructions in the documentation (https_://docs.microfocus.com/doc/423/2021.05/connecttorestapi). The request looks like this:
{ “headers”:
{ “cookie”: “**hidden**”, // “SMAX_AUTH_TOKEN=abcdefg..”
“accept”: “*/*”,
“user-agent”: “Apache-HttpClient/4.1”,
“accept-encoding”: “gzip, deflate, br”,
“content-type”: “application/json” },
“method”: “GET”,
“uri”: “https://dev.smax-hosting.de/rest/123456/ems/Device/123456”,
“gzip”: true,
“rejectUnauthorized”: true,
“followRedirect”: true,
“resolveWithFullResponse”: true,
“followAllRedirects”: true,
“maxRedirects”: 21,
“timeout”: 300000,
“qs”: { “layout”: “FULL_LAYOUT”, “TENANTID”: “123456” },
“encoding”: null,
“json”: false,
“useStream”: true
}
What am I doing wrong?
i’m using n8n Community Edition Version 1.112.4
