openhab / openhab-cloud

Cloud companion for openHAB instances
Eclipse Public License 2.0
314 stars 162 forks source link

Basic authentication? #177

Open Stefan300381 opened 6 years ago

Stefan300381 commented 6 years ago

Hi,

I am using port forwarding in my router to reach my local openhab-cloud instance. The issue:

Using two different dyndns providers I see different results in my browsers (latest Chrome and IE11). http://DYNDNS1:3000 shows the openhab-cloud GUI http://DYNDNS2:3000 shows a pre-popup asking for basic authentication (user/pass). I tried different users/passwords but nothing worked.

Question: Where can I configure this behavior? Why is basic authentication even required?

Stefan

digitaldan commented 6 years ago

basic auth is used for REST calls from the mobile clients and any other API driven clients. I don't know how you are configuring different domains, but there is a config setting to set the primary domain (config-> host), I'm not sure what happens if you try and access this from two different domains, this may affect how cookies are assigned across hosts.

Stefan300381 commented 6 years ago

well, I have just used two different dynamic dns providers. the problematic one is home.xxx.xyz if you lookup the IP address for the domain, please try it in your browser with http://IPADDRESS:3000 and another time with http://home.xxxx.xyz:3000 For me it shows two different results.

digitaldan commented 6 years ago

naming the host 'home' will force basic authentication, see https://github.com/openhab/openhab-cloud/blob/master/app.js#L333 , if you name it something else (http://oh.haupt.xyz:3000 for example) then it will serve the same as using the IP

Stefan300381 commented 6 years ago

ha!!! Thanks for this hint! will change the dns name so issue can be closed