Unauthorized error

Please use template to report bugs and problems. Post here your questions when not sure where else to post
Only for bugs in the Domoticz application! other problems go in different subforums!

Moderators: leecollings, remb0

Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.

Use the following template when posting here:

Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....

If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly

If you are replying, please do not quote images/code from the first post

Please mark your topic as Solved when the problem is solved.
Post Reply
marktn
Posts: 232
Joined: Tuesday 21 April 2015 21:39
Target OS: Windows
Domoticz version:
Contact:

Unauthorized error

Post by marktn »

Hi,

I'm not sure if it's a Node-RED problem or domoticz, but I'm experiencing an issue after removing 192.168.1.* from my trusted networks.
I want to do this because more users are accessing the WebUI.

When I paste this URL into my browser, it works fine:
http://192.168.1.5:8080/json.htm?type=c ... vvalue=100

In Node-RED, I use an HTTP request node with the same URL. It works when 192.168.1.* is included in the trusted networks.

However, without 192.168.1.* in the trusted networks, I get an error in Node-RED:

Code: Select all

"<html><head><title>Unauthorized</title></head><body><h1>401 Unauthorized</h1></body></html>"
I do have the IP address of Domoticz/Node-RED (192.168.1.5) in my trusted network.
Do you have any idea how to solve this? I've read the wiki but couldn't find a solution.
Domoticz latest stable, Intel NUC, Proxmox, Zigate, RFLink, Kaku switches, Ikea lights, Xiaomi sensors, Honeywell smoke detectors, Yeelight, Shelly, Slave Domoticz PI 3B+, Node-Red, Espeasy.
User avatar
jvdz
Posts: 2266
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Unauthorized error

Post by jvdz »

The Wiki has quite an elaborate explanation how the security works: https://www.domoticz.com/wiki/Security
You probably need to read this part for this question: https://www.domoticz.com/wiki/Security#API_Protection
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
marktn
Posts: 232
Joined: Tuesday 21 April 2015 21:39
Target OS: Windows
Domoticz version:
Contact:

Re: Unauthorized error

Post by marktn »

jvdz wrote: Friday 16 August 2024 14:13 The Wiki has quite an elaborate explanation how the security works: https://www.domoticz.com/wiki/Security
You probably need to read this part for this question: https://www.domoticz.com/wiki/Security#API_Protection
Thanks! You pointed me in the right direction.

I made a screenshot with the solution, use authentication in the node.
Attachments
firefox_2024-08-16_14-43-25.jpg
firefox_2024-08-16_14-43-25.jpg (62.82 KiB) Viewed 858 times
Domoticz latest stable, Intel NUC, Proxmox, Zigate, RFLink, Kaku switches, Ikea lights, Xiaomi sensors, Honeywell smoke detectors, Yeelight, Shelly, Slave Domoticz PI 3B+, Node-Red, Espeasy.
User avatar
gizmocuz
Posts: 2471
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Unauthorized error

Post by gizmocuz »

Please try to use HTTPS as that is safer.
Not sure how long basic authentication for HTTP will keep on working
Anyone sniffing your internal network will be able to decode the username/password when using HTTP

https://en.wikipedia.org/wiki/Basic_acc ... entication
Quality outlives Quantity!
janpep
Posts: 259
Joined: Thursday 14 March 2024 10:11
Target OS: Linux
Domoticz version: 2025.1
Location: Netherlands
Contact:

Re: Unauthorized error

Post by janpep »

Is it correct that this "401 Unauthorized" message does not appear anywhere in the log or am I missing something?
Dz on Ubuntu VM on DS718+ behind FRITZ!Box.
EvoHome; MELCloud; P1 meter; Z-Stick GEN5; Z-Wave-js-ui; Sonoff USB-Dongle Plus-E; Zigbee2Mqtt; MQTT; Greenwave powernodes 1+6; Fibaro switch, plugs, smoke; FRITZ!DECT 200. Scripts listed in profile interests.
marktn
Posts: 232
Joined: Tuesday 21 April 2015 21:39
Target OS: Windows
Domoticz version:
Contact:

Re: Unauthorized error

Post by marktn »

janpep wrote: Tuesday 20 August 2024 21:35 Is it correct that this "401 Unauthorized" message does not appear anywhere in the log or am I missing something?
Not in domoticz but in nodered Debug.
Domoticz latest stable, Intel NUC, Proxmox, Zigate, RFLink, Kaku switches, Ikea lights, Xiaomi sensors, Honeywell smoke detectors, Yeelight, Shelly, Slave Domoticz PI 3B+, Node-Red, Espeasy.
janpep
Posts: 259
Joined: Thursday 14 March 2024 10:11
Target OS: Linux
Domoticz version: 2025.1
Location: Netherlands
Contact:

Re: Unauthorized error

Post by janpep »

marktn wrote: Wednesday 21 August 2024 10:20 Not in domoticz but in nodered Debug.
Thank you. Clear.
Actually strange that Domoticz does log a failed login, but not an unauthorized connection attempt.
Dz on Ubuntu VM on DS718+ behind FRITZ!Box.
EvoHome; MELCloud; P1 meter; Z-Stick GEN5; Z-Wave-js-ui; Sonoff USB-Dongle Plus-E; Zigbee2Mqtt; MQTT; Greenwave powernodes 1+6; Fibaro switch, plugs, smoke; FRITZ!DECT 200. Scripts listed in profile interests.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest