eclipse-archived / smarthome

Eclipse SmartHome™ project
https://www.eclipse.org/smarthome/
Eclipse Public License 2.0
862 stars 783 forks source link

REST API Fails through SSL reverse proxy with authentication in mobile app. #2390

Closed stevenmcastano closed 7 years ago

stevenmcastano commented 7 years ago

I've got a sitemap, items, etc... all working fine locally, and if I access the site remotely through a browser, the connection hits my public nginx instance, which is configure to redirect everything to SSL, and it does, and it's configure for anything off of my local network to use authentication.

From a browser, when I log in with my username and password everything works great and I can see through the logs everything is being accessed via the SSL connection and my username, but when I use the app and it attempts to hit the REST API, once is starts looking for "swagger.json" it stops using the username and password and authentication fails. This causes the app to fail.

So it works from a mobile browser through the nginx SSL/auth proxy, but not through the iOS app or the REST API.

Any ideas?

BClark09 commented 7 years ago

You might be in the wrong place here, are you talking about the openHAB iOS app?

Nonetheless, it sounds like you don't have the following line:

proxy_set_header X-Forwarded-Proto      $scheme;

If this doesn't work for you, then have a look at the openHAB docs and compare your setup. I have this working on my partner's iOS so if you continue to have problems perhaps it's better to seek help on the openHAB forums where we can continue this discussion?

kaikreuzer commented 7 years ago

Indeed, it doesn't seem to be an issue for ESH itself, since there isn't even any authentication in place.