Help with GET Requests and their cookies in n8n

Describe the problem/error/question

I am trying to receive meber data of the iracing API. It needs to authenticate (https://members-ng.iracing.com/auth) to retrieve an ssoCookieValue wich i need to set as a value for a cookie in the following GET Request .

Authentication is no problem but in the GET Request i receive an 401.

What is the error message (if any)?

From HTTP Request

Error code

401

Full message

401 - "{\n \"error\": \"Unauthorized\",\n \"message\": \"Requests must be authorized.\"\n}"

Request

{ "headers": { "cookie": "**hidden**", "accept": "application/json,text/html,application/xhtml+xml,application/xml,text/*;q=0.9, image/*;q=0.8, */*;q=0.7" }, "method": "GET", "uri": "https://members-ng.iracing.com/data/member/get", "gzip": true, "rejectUnauthorized": true, "followRedirect": true, "resolveWithFullResponse": true, "followAllRedirects": true, "timeout": 300000, "qsStringifyOptions": { "arrayFormat": "brackets" }, "qs": { "cust_ids": "notMyID", "include_licenses": "true" }, "encoding": null, "json": false, "useStream": true }

Please share your workflow

Information on your n8n setup

  • Running n8n via Cloud:
  • Operating system: Windows

Am i using it right? also tried at the header parameters to use “irsso_memberv2” as name and “{{ $json.ssoCookieValue }}” as value.

Is this a n8n Bug or iracing endpoint bug?

Thanks in advance

Hi from what i know there are more steps to get authenticated from what i read on the documentation here in Postman

As of late 2024 there are more steps required to get authentication working.

  1. Enable Legacy Authentication for your Account

  2. Enabling or Disabling Legacy Read Only Authentication : iRacing

  3. iRacing OAuth - Security Settings

  4. Hash your password. Plain-text submissions will no longer be allowed.

  5. iRacing Authentication

  6. Steps to salt+hash password:

1. Convert the username (email) to lowercase

2. Concatenate the output from step 1 to the end of the password

3. Create a SHA256 hash of the output from step 2 (this should be the binary format)

4. Encode the output from step 3 in Base64

5. Submit the output from step 4 in the `password` field of the login form

Have you tried this?

All this steps where needed in the first POST Request to authenticate and they were implemented. This is not the node that is failing :confused:

I also did find that Postman documentation but under Authorization the Option “inherit from Parents” is selected. Soooo i don’t really see how it is done.

Nevermind, solved it^^

If you have a moment, please share how you solved it.

Assuming you just needed to add the Response option on the HTTP Request node, enable the Include Response Headers and Status part (and maybe also the Never Error part), and then parse the value of ssoCookeValue from the set-cookie header in the response.

1 Like

Yes that’s exactly right. With this option enabled i had access to the required data

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.