I am attempting to to authenticate with an API but I’m not sure how to send data for the credentials like I see in the example below where we in curl you’d usually pass it as a -d parameter. I would appreciate any points on how to format such requests.
What is the error message (if any)?
I’m currently running into a 401 issue due to a formatting issue it appears.
I did try something similar to that initially but had missed the header set but even after trying to add it now I’m getting a 401. I’ve verified credentials work. The platform allows you to initiate a login and use the session cookies sent back to continue to interact for a short time. It sends the data via curl’s -d data function too. I’m curious how I replicate the curl -d functionality.
curl -X POST https://[hostname]:[port]/login.html -d @login.txt --header "ContentType:application/x-www-form-urlencoded" -c cookie.txt
Hey all, the cookies are usually exchanged through the headers. @pemontto shared an example showing this for n8n’s own UI recently:
Relevant here is the full response option of the first HTTP Request node (to see the cookie header coming back after logging in):
And the cookie header configured on the second HTTP Request node.
Have a look at the above thread to see if this can also apply to you and give me shout if you run into any trouble here.