Page 2 of 2

Re: Domoticz authorization error

Posted: Thursday 03 August 2023 17:09
by waltervl
If you use http you HAVE to set the setting "Allow Basic-Auth authentication over plain HTTP (API only)" to "On" in menu Setup-Settings, tab Security.

Re: Domoticz authorization error

Posted: Thursday 03 August 2023 17:12
by Lokonli
swilting wrote: Thursday 03 August 2023 12:58 I also have this error after I updated to the last version of Domoticz,

Is there one simple solution for the issue :?:

*) updated to the Beta version of Dashticz
*) have my IP range in the "trusted network settings" (was already there) (10.0.0.*)
*) try'd the username / password option in the config.js

In my opinion it just shoud work

I can't see any login attempts in the logging of Domoticz, do i have to switch this on somewhere?
You have to do all the following things:

In CONFIG.js add the Domoticz username and password, like

Code: Select all

config['user_name'] = 'admin';
config['pass_word'] = 'domoticz';
In Domoticz->Settings->Security tab:
  • Tick 'Allow Basic-Auth authentication over plain HTTP' in Domoticz->Settings->Security->API protection
  • Fill in your local subnet in Trusted Networks
Example of Domoticz settings:

Re: Domoticz authorization error

Posted: Friday 04 August 2023 20:25
by swilting
Thank you, that did the trick

(I still find it strange to set a trusted network IP and then still have to set a username and a password)

Re: Domoticz authorization error

Posted: Friday 04 August 2023 20:43
by Lokonli
swilting wrote: Friday 04 August 2023 20:25 (I still find it strange to set a trusted network IP and then still have to set a username and a password)
I'll fix that in a next update.

Re: Domoticz authorization error

Posted: Saturday 05 August 2023 21:46
by kiddigital
Lokonli wrote:
swilting wrote: Friday 04 August 2023 20:25 (I still find it strange to set a trusted network IP and then still have to set a username and a password)
I'll fix that in a next update.
Dashticz should be given access to domoticz’s API either by adding the Dashticz IP-address to the trusted network OR via username and password.

These 2 ways should be mutually exclusive. It is one or the other, never both.

And, in case you access the domoticz API over HTTP instead of HTTPS, you have to enable ‘basic-auth over http’. This is independent of the above option you use to give Dashticz access to domoticz.

Best, prefered and most secure way is to run domoticz with HTTPS enabled and create a specific user for Dashticz to use. Configure Dashticz to access domoticz over HTTPS using the specific username and password.

(Or even better, Dashticz should become able to leverage the OAuth2 functionality of domoticz and access the domoticz API after acquiring an access token. But that is for the future).