# Send password and username from UI Dashboard to http request

**URL:** <https://discourse.nodered.org/t/send-password-and-username-from-ui-dashboard-to-http-request/74118>\
**Category:** Dashboard\
**Tags:** security\
**Created:** [24 January 2023 12:21 UTC](https://discourse.nodered.org/t/send-password-and-username-from-ui-dashboard-to-http-request/74118 "2023-01-24T12:21:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DAD](https://avatars.discourse-cdn.com/v4/letter/d/b77776/32.png) [@DAD](https://discourse.nodered.org/u/DAD)\
**Post date:** [24 January 2023 12:21 UTC](https://discourse.nodered.org/t/send-password-and-username-from-ui-dashboard-to-http-request/74118/1 "2023-01-24T12:21:04Z")

</div>

Hi everyone, I have a question. I have a NodeRED flow that goes to a website via http request and does different things there. This website requires login data (username and password). So far I have entered the login data directly in HTTP request node (see picture)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/9/c9d58abee997e9fd3b420dcaea848a44a91a801a.png)

I want to send the login data via UI Dashboard to the HTTP request and save it there until the user logs out again. For example

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/6/36312701301b05f5de650b5aeb4452d240aed065.png)  
I worked with msg.headers but it didn't work or maybe I didn't use it properly. can someone please help me or can someone give me an example?

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [24 January 2023 15:27 UTC](https://discourse.nodered.org/t/send-password-and-username-from-ui-dashboard-to-http-request/74118/2 "2023-01-24T15:27:50Z")

</div>

You can set headers in the http request node or feed headers in  
so  
`headers.Authorization = "Basic user:pass"`. user:pass must be base64encoded.

> **[Authorization - HTTP | MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization#examples)**
>
> The HTTP Authorization request header can be used to provide credentials that authenticate a user agent with a server, allowing access to a protected resource.

---

<div class="post-metadata">

**Author:** ![kevinGodell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kevingodell/32/27040_2.png) [@kevinGodell](https://discourse.nodered.org/u/kevinGodell)\
**Post date:** [24 January 2023 22:02 UTC](https://discourse.nodered.org/t/send-password-and-username-from-ui-dashboard-to-http-request/74118/3 "2023-01-24T22:02:22Z")

</div>

> [@DAD](#):
>
> I worked with msg.headers but it didn't work or maybe I didn't use it properly. can someone please help me or can someone give me an example?

Based on the title of your post, are you simply trying to pre-populate the request node with your credentials send from the ui widget? Or are you having trouble with the http request itself?

Sorry for not understanding, but it is not obvious what you are trying to accomplish.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [25 March 2023 22:03 UTC](https://discourse.nodered.org/t/send-password-and-username-from-ui-dashboard-to-http-request/74118/4 "2023-03-25T22:03:19Z")

</div>

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