# SSE Client with digest auth

**URL:** <https://discourse.nodered.org/t/sse-client-with-digest-auth/38874>\
**Category:** General\
**Created:** [10 January 2021 01:42 UTC](https://discourse.nodered.org/t/sse-client-with-digest-auth/38874 "2021-01-10T01:42:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![injector22](https://avatars.discourse-cdn.com/v4/letter/i/e9bcb4/32.png) [@injector22](https://discourse.nodered.org/u/injector22)\
**Post date:** [10 January 2021 01:42 UTC](https://discourse.nodered.org/t/sse-client-with-digest-auth/38874/1 "2021-01-10T01:42:20Z")

</div>

I'm trying to set up an SSE client to receive data, but the device requires digest auth. I can easily auth using the standard http node but not when using the SSE client node.

> **[node-red-contrib-sse-client](https://flows.nodered.org/node/node-red-contrib-sse-client)**
>
> A Node Red node to receive Server Sent events

Does anyone know how I can pass the session cookie from the http node to the SSE node?

---

<div class="post-metadata">

**Author:** ![injector22](https://avatars.discourse-cdn.com/v4/letter/i/e9bcb4/32.png) [@injector22](https://discourse.nodered.org/u/injector22)\
**Post date:** [10 January 2021 15:17 UTC](https://discourse.nodered.org/t/sse-client-with-digest-auth/38874/2 "2021-01-10T15:17:36Z")

</div>

I figured out how to use the HTTP node which supports digest and pass the cookie along to the SSE node.

Here's the flow in case someone runs into the same issue:

```auto
[{"id":"830c8b80.f89718","type":"inject","z":"f194162.538f0e8","name":"Start / Restart / Unpause stream","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":290,"y":520,"wires":[["5944b091.17285"]]},{"id":"de79afb2.f459b","type":"inject","z":"f194162.538f0e8","name":"Pause stream","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":350,"y":640,"wires":[["31c2c1a4.b6aabe"]]},{"id":"3e4f28c7.35f5c8","type":"debug","z":"f194162.538f0e8","name":"Display event","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":980,"y":560,"wires":[]},{"id":"31c2c1a4.b6aabe","type":"change","z":"f194162.538f0e8","name":"","rules":[{"t":"set","p":"pause","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":640,"wires":[["50364aa0.f4b3d4"]]},{"id":"fc7709e7.f95788","type":"inject","z":"f194162.538f0e8","name":"Stop stream","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":350,"y":600,"wires":[["fc633663.b0ce48"]]},{"id":"fc633663.b0ce48","type":"change","z":"f194162.538f0e8","name":"","rules":[{"t":"set","p":"stop","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":600,"wires":[["50364aa0.f4b3d4"]]},{"id":"50364aa0.f4b3d4","type":"sse-client","z":"f194162.538f0e8","name":"","url":" http://10.10.99.8/stream/meter","events":["message"],"headers":{},"proxy":"","restart":true,"rejectUnauthorized":false,"withCredentials":true,"timeout":"10","x":810,"y":620,"wires":[["3e4f28c7.35f5c8"]]},{"id":"5944b091.17285","type":"http request","z":"f194162.538f0e8","name":"","method":"GET","ret":"txt","paytoqs":false,"url":"http://10.10.99.8/installer/setup/home","tls":"","persist":false,"proxy":"","authType":"digest","x":530,"y":520,"wires":[["5e0c1620.061b18"]]},{"id":"5e0c1620.061b18","type":"function","z":"f194162.538f0e8","name":"Set Cookie","func":"msg.headers = {'Cookie': 'sessionId=' + msg.responseCookies.sessionId.value};\nreturn msg;","outputs":1,"noerr":0,"x":730,"y":520,"wires":[["50364aa0.f4b3d4"]]}]

```

---

<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:** [10 January 2021 18:46 UTC](https://discourse.nodered.org/t/sse-client-with-digest-auth/38874/3 "2021-01-10T18:46:51Z")

</div>

Hi @injector22,  
We meet again 😉  
Good that you contacted me on Github, because I hadn't seen your question here. The amount of posts on Discourse is just too much to keep following all of them...

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [10 January 2021 23:03 UTC](https://discourse.nodered.org/t/sse-client-with-digest-auth/38874/4 "2021-01-10T23:03:30Z")

</div>

> [@BartButenaers](#):
>
> The amount of posts on Discourse is just too much to keep following all of them...

With the number of nodes you have created, I, for one, will forgive you 🤣

---

<div class="post-metadata">

**Author:** ![injector22](https://avatars.discourse-cdn.com/v4/letter/i/e9bcb4/32.png) [@injector22](https://discourse.nodered.org/u/injector22)\
**Post date:** [11 January 2021 01:01 UTC](https://discourse.nodered.org/t/sse-client-with-digest-auth/38874/5 "2021-01-11T01:01:56Z")

</div>

No worries Bart. I normally start here and if no one has ran into the same issue then I try to bug the dev. Thanks for you help on figuring this out.

---

<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 January 2021 01:01 UTC](https://discourse.nodered.org/t/sse-client-with-digest-auth/38874/6 "2021-01-25T01:01:59Z")

</div>

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