HTTP authentication doesn't seem to be doing the authentication

Hi.

I’m trying to access a website using HTTP header authentication.

I tried using using basic auth but it doesn’t work.

Using the network monitoring tools in Firefox and Chrome, I see that when I use the form directly and submit my user ID and password, it works correctly. But when I do it using the HTTP request, it is as if the authentication does not go through. Almost as if I’m trying to access the URL without sending the user ID and password. However, because there is a default page, if you try to access it without authentication, I don’t get a 403 error; instead, I get the result of the redirection.

How can I fix this?

Ideally, if I’m able to create an authentication header on the first call I make, I would like to be able to reuse that throughout, but I’m not sure how.

Thanks,

L

Hey @DupervalAI

There is a redirect option in http request node. Have you tried fiddling with it?

I did not know that and I tried the option and get the same result. I asked to output the headers also and the response is a 200, but the data I receive i s not what I expect to see when the authentication is successful.

I’m assuming, though I’m possibly (probably?) wrong, that if I can successfully log in manually, I should be able to reuse that login information and use it as the header, but I’m unable to find anything that looks like an authentication record using the Chrome/Firefox console. Could it be that I’m not using the right approach to find that?

I’m using the Network tab and I enabled the “Preserve log” option to allow the following of redirects but I’m not seeing anything.

I also tried to do it from my n8n instance but I don’t think I’m doing it correctly because I don’t see any traffic when the workflow. Presumably because everything happens on the server and the browser doesn’t have access to it. Are there other monitoring methods I can use?

My instance is running on a Google Cloud VM.

Thanks,

L

You are right in thinking that reusing the values from dev tools in your browser will get you the same result when used in other tools. To test, you could, for example, try to right click on a request on the network tool and copy as cURL and then run the same request in the terminal. Don’t know what exactly could be the difference without trying it myself.

Thanks, I’ll need to work on this to figure out what I need to do. I’ll try out the curl approach to see.

L