# Passing digest credentials to http-request node

**URL:** <https://discourse.nodered.org/t/passing-digest-credentials-to-http-request-node/58105>\
**Category:** General\
**Tags:** http-request\
**Created:** [10 February 2022 20:43 UTC](https://discourse.nodered.org/t/passing-digest-credentials-to-http-request-node/58105 "2022-02-10T20:43:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Letis009](https://avatars.discourse-cdn.com/v4/letter/l/b3f665/32.png) [@Letis009](https://discourse.nodered.org/u/Letis009)\
**Post date:** [10 February 2022 20:43 UTC](https://discourse.nodered.org/t/passing-digest-credentials-to-http-request-node/58105/1 "2022-02-10T20:43:37Z")

</div>

Hi ,  
I am struggling with using the stock http-request node  
You can set URL and METHOD with msg properties but not authentication options

I have a flow that pulls the url, method and credentials  
This works fine with basic because I can set headers in a change node  
I understand Digest is more complicated and can use crypto-js node to create a digest hash but it isnt just the password that is hashed

Can anyone point me towards info to either edit the stock http-request node to accept credentials via msg or a function to build the digest header before send msg to http-request

End result is would like a dashboard that can request still images from several image stores that use different methods and credentials so these can not be static

Any guidance welcome  
Stephen

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [10 February 2022 21:41 UTC](https://discourse.nodered.org/t/passing-digest-credentials-to-http-request-node/58105/2 "2022-02-10T21:41:20Z")

</div>

If the credentials need some processing (digest hash before adding them to `msg.headers`) then, as you noticed also, you'll need a Function node. If you need the crypto-js library for that then you can require it using `functionExternalModules` option.

[Using the `functionExternalModules` option](https://nodered.org/docs/user-guide/writing-functions#using-the-functionexternalmodules-option)

---

<div class="post-metadata">

**Author:** ![Letis009](https://avatars.discourse-cdn.com/v4/letter/l/b3f665/32.png) [@Letis009](https://discourse.nodered.org/u/Letis009)\
**Post date:** [11 February 2022 05:40 UTC](https://discourse.nodered.org/t/passing-digest-credentials-to-http-request-node/58105/3 "2022-02-11T05:40:21Z")

</div>

Thanks UnborN  
You are correct that I would use a function node with crypto-js as external module but I am looking for more information regarding the hash construction that http-request uses as it is perfectly functional when I can use credentials statically

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [11 February 2022 06:45 UTC](https://discourse.nodered.org/t/passing-digest-credentials-to-http-request-node/58105/4 "2022-02-11T06:45:27Z")

</div>

How to build a http digest hash are in the http RFCs documents

Specifically [RFC 7616 - HTTP Digest Access Authentication](https://datatracker.ietf.org/doc/html/rfc7616)

---

<div class="post-metadata">

**Author:** ![Letis009](https://avatars.discourse-cdn.com/v4/letter/l/b3f665/32.png) [@Letis009](https://discourse.nodered.org/u/Letis009)\
**Post date:** [11 February 2022 07:52 UTC](https://discourse.nodered.org/t/passing-digest-credentials-to-http-request-node/58105/5 "2022-02-11T07:52:52Z")

</div>

Awesome  
Exactly what I was looking for  
A beer for you sir

---

<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 February 2022 07:52 UTC](https://discourse.nodered.org/t/passing-digest-credentials-to-http-request-node/58105/6 "2022-02-25T07:52:57Z")

</div>

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