Different Username and password for remote and local url

Hi all,

Habdroid has separate setting for remote and local url but only one Username and password. I have different Username and password when coonecting from my local network and different for myopenhab so i need to change settings every time i want to connect from different networks. How can i make my life easier ?

How did you set up your system that it requires a username/password for local connections?
When set up through the official install instructions that is not the preferred method …

Well, the openhab supports the authentication, and i want to grant access to it in my local network only for certain users. I did it the way it is described here https://github.com/openhab/openhab/wiki/Security. why this is not reccomended ?

I did not say “recommended”, I said preferred. Because it makes setup a little bit more complicated (but I agree, it makes it more secure).
I cannot help with that, I use my openHAB “open” in my LAN.

When I tried that a long time ago, setting security to external worked fine, but that is, what I’ve understand from your post, also not what you want.

Prior to the release a few weeks ago the only way to get my.openhab support was to have security set to EXTERNAL or NONE. Therefore there was never a need to support multiple usernames and passwords in Habdroid or the iOS app. It just assumed you needed them when not on the LAN and didn’t when not.

File an issue on the Habdroid github and the iOS app github to have this added. Though be aware it might not be implemented until support for authentication is finally implemented in openHAB 2.

i have in my openhab.cfg:
security:option=EXTERNAL
security:netmask=192.168.0.0/256

in my users.cfg:
marek=

the address of the OpenHAB server is 192.168.0.4. When connecting from my pc (address 192.168.0.6) using web browser I’m asked for the login and password. This is the way it worked since i’ve set it up about half year ago. So how there was no need to support for multiple usernames and passwords ?

Something weird was going on then because with security set to EXTERNAL it should only ask for a password on requests from device not on the LAN.

Perhaps it asks for the password when you use https all the time. Were you using that?

In any case, the communication between OH and Habdroid when on the LAN does not use HTTPS so no user/password is required.

in habdroid a have:
openHAB URL:
http://192.168.0.4:8081
openHAB Remote URL:
https://my.openhab.org

if i’m connecting using habdroid from local network and have set username and password to those for my.openHAB i get “Authentication Failed. Please check Username/Password settings”. Setting username and password to those from user.cfg solves that.

When connecting from PC using chromium from local network using address http://192.168.0.4:8081/openhab.app?sitemap=blablabla i get a popup “Authentication Required, http://192.168.0.4:8081 requires a username and password. Your connection to this site is not private.”

Then something is broken with the EXTERNAL security setting. Make sure it is spelled correctly. Look in the logs and make sure you see it setting the security policy near the start of openHAB starting up (you may need to turn on debug logging).

Your OH is behaving as if you had security set to ALL (or FULL or whatever the full setting is).