Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REVERSE_PROXY_AUTH with /api access #789

Open
zjean opened this issue Apr 1, 2024 · 4 comments · Fixed by #790
Open

REVERSE_PROXY_AUTH with /api access #789

zjean opened this issue Apr 1, 2024 · 4 comments · Fixed by #790
Labels
enhancement Feature requests or improvements to existing functionality help wanted Issues where maintainers could use assistance from others

Comments

@zjean
Copy link
Contributor

zjean commented Apr 1, 2024

Hi, I am using the babybuddy web app with REVERSE_PROXY_AUTH setup (with Authelia).
That works great.
One thing however: I would like te use the api with token based authentication. I did so by whitelisting the /api from my Authalia config.
However, it looks like the Babybuddy is expecting the reverse proxy auth header for the /api endpoint.
Is it possible to exclude this header check for the api?

@cdubz
Copy link
Member

cdubz commented Apr 13, 2024

This makes sense -- #790 needed a small fix. Thanks for contributing!

@cdubz cdubz added the enhancement Feature requests or improvements to existing functionality label Apr 13, 2024
@zjean
Copy link
Contributor Author

zjean commented Apr 20, 2024

Hmm, my solution in this PR does not work.
First of all the check for "api/" is incorrect, it should be "/api/".
But, next to that, I always get a 403 error, even when I am sure the 'return None' is called in the middleware.

My knowledge of Python/Django is almost non-existent, so I have no clue how to debug this.
Any suggestions?

@zjean
Copy link
Contributor Author

zjean commented Apr 23, 2024

@cdubz
It looks like something weird goes on in the authentication backends for the remote user on the /api path.
The request is denied, I think because of the remote_user being empty.

When I change the RemoteUserBackend in settings/base.py to AllowAllUsersRemoteUserBackend the API is accessible, however I am not sure whether this has any implications..

@cdubz
Copy link
Member

cdubz commented Apr 24, 2024

Hm yeah I'm not sure why that would make a difference based on Django's documentation for that backend: https://docs.djangoproject.com/en/5.0/ref/contrib/auth/#django.contrib.auth.backends.AllowAllUsersRemoteUserBackend

🤔

@cdubz cdubz reopened this Apr 24, 2024
@cdubz cdubz added the help wanted Issues where maintainers could use assistance from others label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests or improvements to existing functionality help wanted Issues where maintainers could use assistance from others
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants