| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…openHAB 3+ When using nginx basic auth in front of openHAB 3+, two authentication layers end up competing for the same HTTP Authorization header: nginx sets it to "Basic ..." and openHAB sets it to "Bearer ..." after login. This causes the openHAB login to fail when basic auth is enabled on the reverse proxy. Adding the X-OPENHAB-AUTH-HEADER cookie instructs the openHAB UI to use the X-OPENHAB-TOKEN header instead of Authorization for its own token, resolving the conflict and allowing both nginx basic auth and openHAB authentication to coexist correctly. Reference: https://community.openhab.org/t/oh3-with-nginx-reverse-proxy-and-authentication/106528
|
This pull request has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Description
Add X-OPENHAB-AUTH-HEADER cookie to the openHAB nginx reverse proxy
configuration. When nginx basic auth is enabled, both nginx and openHAB 3+
compete for the HTTP Authorization header — nginx sets it to Basic ...
while openHAB sets it to Bearer ... after login. This causes openHAB
authentication to fail silently when accessed through the proxy.
The fix instructs the openHAB UI to use the alternative X-OPENHAB-TOKEN
header for its own token instead of Authorization, allowing both
authentication layers to coexist without conflict.
Benefits of this PR and context
Without this fix, users who enable nginx basic auth on top of openHAB 3+
experience a broken login flow: the openHAB login page appears to accept
credentials but immediately fails, requiring the user to dismiss the nginx
auth popup and re-authenticate through openHAB's own login screen. This
is a known issue affecting all openHAB 3+ installations behind a nginx
reverse proxy with basic auth enabled.
This one-line addition makes the sample configuration work correctly
out of the box for openHAB 3+ without affecting openHAB 2.x compatibility.
How Has This Been Tested?
Tested on a personal homelab running:
configuration
Verified that after adding the cookie header:
Source / References
Schaus): https://community.openhab.org/t/oh3-with-nginx-reverse-proxy-and-authentication/106528