Getting REST access to nodered

HI Team

Want’ed to try out some REST calls against nodered but get 401 errors.
I have been looking, but without solutions. Can some one please give a hint :wink:

NodeRed is deployed as an ‘Add-ons’

when issuing this command from my local pc:
pi@rasp:~ $ curl -i http://192.168.2.85:1880/hello-json

I get:
HTTP/1.1 401 Unauthorized

www-authenticate: Basic realm=“Home Assistant”

the log in Node-red says:
[22/Sep/2020:23:04:22 +0200] 401 -(192.168.2.28) GET /hello-json HTTP/1.1 (curl/7.64.0)

So it seems to be connected, but not getting through.

Node-red config:
credential_secret: aaaaaaaaa
dark_mode: false
http_node:
username: bbbbbb
password: ccccccc
http_static:
username: ‘’
password: ‘’
ssl: false
certfile: fullchain.pem
keyfile: privkey.pem
require_ssl: true
system_packages: []
npm_packages: []
init_commands: []

So it has something to do with the username/password.

How do I add these ?

/Joern

Please use code fencing around your configuration.
YAML is a white-space sensitive declarative language so we need to be able to see exactly how you’ve spaced your config.

Click this button:

image

and paste your config in there, or place three backticks (```) before and after the configuration.

If you haven’t changed the default configuration, you need “endpoint” in the url. It should be:

http://192.168.2.85:1880/endpoint/hello-json
2 Likes

HI …

Yes - adding endpoint helped - Thanks.

pi@rasp:~ $ curl -i http://<http_node user name>:<password>@192.168.2.85:1880/endpoint/hello-json

Did the trick.

or just access from web browser, where the user/password is challenged.

So, onward to next task…

Thanks.