When using some method other than a browser to connect to Domoticz it may be necessary to do Authorization differently. Authorization over HTTP is done by setting the "Authorization" HTTP request header when sending the request to Domoticz. The value of this header is a base64 encoded string of the username and password. When connecting to Domoticz using a browser and the URL method above the browser sets the appropriate header. When creating your own app or script this is not always done for you.
- First the username and password are combined into one string "usernameassword"
- This string is encoded using the RFC2045-MIME version of base64
- The authorization method and a space i.e. "Basic " is then put before the encoded string.
This results in a header in the following format:
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==