-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Support for Reverse Proxy authentication backends (like authelia) #866
Conversation
Thanks for this PR and the documentation PR to go with it! It looks like it's on a good track so far. Quick question: Where is |
Everything is handled by standard |
Let me also explain how this is supposed to work, to ensure that we're on the same page :) :
Hopefully this clears things up, and explain what I'm trying to build here :) |
@pirate @dugite-code Hi, any chance of this PR being merged soon? Or where are things left? It would be quite nice to get it through. |
I've been running this patched into the current version of ArchiveBox for a while. As long as the user exists initially the SSO works as expected, however any auto-created users do not have the correct permissions assigned leaving users stuck on the login page with the message: The user needs to be set as staff and at least given viewing permissions, although it appears you can still add/remove snapshots with just viewing permissions. Note: you cannot modify auto created users after the fact. |
What about adding a server config option that adds the Another option could be to alter RemoteUserBackend.configure_user to add the necessary permissions and flags (depending on more server config options). |
Co-authored-by: dugite-code <[email protected]>
I'm also experiencing this. Would it be possible to add another config option for which permissions to grant automatically created users? |
Yes, we recently added this same fix for LDAP auth here: #1335 I would just set Unfortunately I'm a bit overloaded with paying client work right now so I probably won't get around to implementing this myself, but if you submit a PR to add this I'd be happy to review it! |
I'm getting CSRF errors when I try and do things like a re-crawl. I have my From looking online it seems like there ought to be a setting to allow TRUSTED_HOSTS or otherwise USE_X_FORWARDED_HOST = True should be true in Django I think?
|
It's possible, can you test if that change fixes it and report back?
|
Seeing the same during a regular login with the CSRF_TRUSTED_ORIGINS = ["https://my.archivebox.domain"] Side note: The logout button does not work either since it results in a GET request, but needs a POST with CSRF token. |
As a quick fix for this I just edited my docker-compose as follows (inserting my reverse proxied external address into the trusted origins line.
|
The same fix for k8s:
|
Ok this should be fixed now on I've added |
Summary
Adds support to reverse proxy authentication backends (like authelia) via configured HTTP header.
Related issues
#773
Changes these areas