# HTTP request node - authentication keeps turning itself back on

**URL:** <https://discourse.nodered.org/t/http-request-node-authentication-keeps-turning-itself-back-on/11260>\
**Category:** General\
**Created:** [17 May 2019 20:26 UTC](https://discourse.nodered.org/t/http-request-node-authentication-keeps-turning-itself-back-on/11260 "2019-05-17T20:26:10Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![hazymat](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hazymat/32/108159_2.png) [@hazymat](https://discourse.nodered.org/u/hazymat)\
**Post date:** [17 May 2019 20:26 UTC](https://discourse.nodered.org/t/http-request-node-authentication-keeps-turning-itself-back-on/11260/1 "2019-05-17T20:26:10Z")

</div>

Bit of a strange one.

Recently I noticed my "turn on the radio" buttons stopped working. These are HTTP request nodes that call my squeezebox server to start playing an audio favourite.

When I investigated, I double-checked the URL by copy-pasting it into a browser, and sure enough this starts the radio as expected. But when I press a Node-RED dashboard button or inject a message, it doesn't work.

I noticed the basic authentication was turned on. Odd, because I had never set this up.

I turned it off, re-deployed, and it stayed off. Then next time I went to edit the node, it had magically turned itself back on.

See video: [https://youtu.be/hcfvKrkLNZ4](https://youtu.be/hcfvKrkLNZ4)

Any ideas?!

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [17 May 2019 21:13 UTC](https://discourse.nodered.org/t/http-request-node-authentication-keeps-turning-itself-back-on/11260/2 "2019-05-17T21:13:53Z")

</div>

Hi Mat (@hazymat),

Seems you are running an older version of Node-RED, since on more recent versions the http-request node offers multiple authentication types:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/c2769d11cd21ebdf3d163612526a6b748a2e77bf.png)

But in the new version of the http-request node I can reproduce the same issue!

1. I have username (sdfsf) and password.

2. Then I unselect the 'use authentication'.

3. The I deploy and when I reopen the config screen the credentials are indeed erased (in the oneditprepare):

4. I press 'Done' and reopen the config screen again, but now the username is again available (in oneditprepare):

5. As a result, you arrive at this line which will reactivate the checkbox again:

That is the cause.  
But unfortunately my time is up for today ...

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [17 May 2019 21:20 UTC](https://discourse.nodered.org/t/http-request-node-authentication-keeps-turning-itself-back-on/11260/3 "2019-05-17T21:20:54Z")

</div>

Perhaps something to do with chrome auto fill repopulating the user field?

Anyhow, I'd suggest raising an issue on GitHub. There maybe a need for the author to add a bool var to remember it was selected/unselected rather than assuming the user wants to use authentication if the username or password has a value?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [17 May 2019 21:28 UTC](https://discourse.nodered.org/t/http-request-node-authentication-keeps-turning-itself-back-on/11260/4 "2019-05-17T21:28:45Z")

</div>

I cannot reproduce it here with either Chrome or Firefox.

The code explicitly sets the fields to blank strings when you untick the box - [https://github.com/node-red/node-red/blob/cc051544f95501c7a24da2b78a511963a71d61ad/packages/node\_modules/%40node-red/nodes/core/io/21-httprequest.html#L136-L139](https://github.com/node-red/node-red/blob/cc051544f95501c7a24da2b78a511963a71d61ad/packages/node_modules/%40node-red/nodes/core/io/21-httprequest.html#L136-L139)

So this could be the auto-fill issue. Raising an issue won't add anything to help resolve that.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [17 May 2019 21:36 UTC](https://discourse.nodered.org/t/http-request-node-authentication-keeps-turning-itself-back-on/11260/5 "2019-05-17T21:36:11Z")

</div>

Perhaps not but wouldn't using a var to remember users choice circumvent this?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [17 May 2019 21:37 UTC](https://discourse.nodered.org/t/http-request-node-authentication-keeps-turning-itself-back-on/11260/6 "2019-05-17T21:37:15Z")

</div>

To be a little more clear, in the server side, don't use auth if bool var is NOT true

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [17 May 2019 21:43 UTC](https://discourse.nodered.org/t/http-request-node-authentication-keeps-turning-itself-back-on/11260/7 "2019-05-17T21:43:52Z")

</div>

Hi guys,  
It might indeed be related to auto-fill, because from time to time I get a **popup** (which I have never seen in the past):

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/7/702b94b362ebf043ba60af15a39879e2d3b791ad.png)

Now I'm really off ...

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [17 May 2019 21:44 UTC](https://discourse.nodered.org/t/http-request-node-authentication-keeps-turning-itself-back-on/11260/8 "2019-05-17T21:44:54Z")

</div>

The blue background to the field was also a clue from your earlier screenshot.

---

<div class="post-metadata">

**Author:** ![hazymat](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hazymat/32/108159_2.png) [@hazymat](https://discourse.nodered.org/u/hazymat)\
**Post date:** [17 May 2019 22:49 UTC](https://discourse.nodered.org/t/http-request-node-authentication-keeps-turning-itself-back-on/11260/9 "2019-05-17T22:49:07Z")

</div>

Thanks

- I've upgraded to latest Node-RED
- Removed the managed password for the IP address in the browser

Now it no longer sets the "use authentication".

However my GET URL doesn't seem to work. When I paste URL into the browser, music starts. But when I inject, it no longer works to start the music.

How can I start to troubleshoot this?

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [18 May 2019 20:17 UTC](https://discourse.nodered.org/t/http-request-node-authentication-keeps-turning-itself-back-on/11260/10 "2019-05-18T20:17:55Z")

</div>

Hi Mat,  
Did you have luck meanwhile, or are you still stuck. I assume you have already added a debug node to the output of your http-request node? Does that give any clue?

I have just released version 2.0.1 of the [node-red-contrib-http-logger](https://discourse.nodered.org/t/announce-node-red-contrib-http-logger/4178/18), since the previous version didn't support recent NodeJs versions. Don't know if that could somehow be of any help for your troubleshooting? But (at least if my new version works correctly) then you could compare the request send by the http-request node, and the request send by the browser (via your browser's developer tools) when you specify the url directly.

---

<div class="post-metadata">

**Author:** ![hazymat](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hazymat/32/108159_2.png) [@hazymat](https://discourse.nodered.org/u/hazymat)\
**Post date:** [19 May 2019 10:35 UTC](https://discourse.nodered.org/t/http-request-node-authentication-keeps-turning-itself-back-on/11260/12 "2019-05-19T10:35:12Z")

</div>

Hi @BartButenaers! Nice to hear from you.

I was having another problem last night with Node-RED not deploying properly:

```
Deploy Failed: no response from server

```

(almost every time I tried to deploy).

I did the following, and all my problems have now gone:

- Update Node-RED to latest version
- Deleted all stored passwords in Chrome (resolved issue where box was getting re-ticked)
- Rebooted the server (resolved the http request node not working AND deploy failed)

---

<div class="post-metadata">

**Author:** ![BeKay1211](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@BeKay1211](https://discourse.nodered.org/u/BeKay1211)\
**Post date:** [21 May 2019 02:18 UTC](https://discourse.nodered.org/t/http-request-node-authentication-keeps-turning-itself-back-on/11260/13 "2019-05-21T02:18:44Z")

</div>

Sooo.. I had the same issue and for me going into chromes settings and deleting the autofill stuff related to my node-red url solved it to me.
