Feature/reverse proxy web auth - #997
Open
Meganitrospeed wants to merge 26 commits into
Open
Conversation
Author
Owner
|
Thank you very much for your contribution! I think if this works for you I will simply merge it and other users can then request improvements if required. |
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
This PR adds support for Grocy instances protected by an interactive reverse proxy, such as Authentik.
Currently, when Grocy Android checks
/api/system/info, the reverse proxy can return its HTML login page instead of the expected Grocy JSON response. The app then displays “Target is not a Grocy instance.”My Grocy installation uses the following configuration:
Changes
HttpURLConnection.GROCY-API-KEYheader for Grocy API authentication.This does not implement OAuth/OIDC directly. The WebView establishes the reverse proxy’s existing browser session, after which the app continues using the normal Grocy API.
Security considerations
X-Authentik-Username; the trusted reverse proxy remains responsible for injecting that header.Automated tests
Unit tests were added for:
Testing performed
I tested the implementation with an Authentik-protected Grocy installation using the reverse-proxy middleware configuration shown above.
Additional testing of other identity providers and reverse-proxy configurations would be appreciated.