fblackburn1 / node-red-contrib-hubitat

MIT License
18 stars 4 forks source link

Node Red Basic HTTP Auth not working #118

Closed jpoeppelman1 closed 3 years ago

jpoeppelman1 commented 3 years ago

When I enable Node Red with httpNodeAuth, the Hubitat MakerAPI webhook fails. Is there a way to pass the header token from Hubitat? In general, how can we secure the NR Hubitat HTTP inbound endpoint for MakerAPI? If I expose my NR instance using SSL, then the webhook is exposed inherently.

NR settings.js config below...

httpNodeAuth: {user:"user",pass:"$2a$08$zZWtXTja0fB1pzD4sHCMyOCMYz2Z6dNbM6tl8sJogENOMcxWV9DN."},

fblackburn1 commented 3 years ago

Did you try this procedure?`

https://community.hubitat.com/t/node-red-nodes-for-hubitat/34386#how-to-configure-webhook-after-configuring-node-red-authenticationhttpsnoderedorgdocsuser-guideruntimesecuring-node-red-21

I should add it to the README too

jpoeppelman1 commented 3 years ago

Did you try this procedure?`

https://community.hubitat.com/t/node-red-nodes-for-hubitat/34386#how-to-configure-webhook-after-configuring-node-red-authenticationhttpsnoderedorgdocsuser-guideruntimesecuring-node-red-21

I should add it to the README too

I tried this and it's not working. I also tried in Postman just to see if I could get some info as to whether or not it would connect.

I'm using nginx with SSL on port 443 and forwarding into NR docker image on port 1880. This setup works fine without NR auth enabled. Below is the error message in Postman, it thinks I'm sending a port in the URL.

POST https://user:SX9999999@192.168.1.138/hubitat/webhook____ Error: Port should be >= 0 and < 65536. Received SX99.

jpoeppelman1 commented 3 years ago

UPDATE - I got this working. Had to URL encode my password, works fine now, thanks!