SSE Client with digest auth

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.

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

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:

[{"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"]]}]
1 Like

Hi @injector22,
We meet again :wink:
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...

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

1 Like

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.

1 Like