-
Notifications
You must be signed in to change notification settings - Fork 3.6k
feat: configurable logout page URL for proxy/hook auth #3884
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
Conversation
hacdias
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jake-dog this is nice. I just updated your PR with the latest changes from main. Could you see my comment above?
Also, could you validate if it works correctly with my updates?
…th with custom logout is used
4bd9953 to
989ad5a
Compare
|
During testing I discovered that the idle timeout mechanism from #5439 conflicts with proxy auth's external token lifetime. As a temporary fix I've disabled the idle timeout logout mechanism when proxy auth and custom logout is used (eebfdbc), however a future improvement could be allow the idle timeout to be set to an arbitrary user configured value, or disabled entirely (set zero or negative). Furthermore I noticed that the JWT was being accidentally validated twice per request due to #5535. The first token validation occurs in Line 71 in 79980bc
Line 76 in 79980bc
Filebrowser can regain a tiny bit of performance by omitting the redundant validation (8e5c0b1). Breadcrumbs for how JWTv5 ParseFromRequest also validates |
989ad5a to
8e5c0b1
Compare
hacdias
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few questions!
Update 2025-05-13: I've been running this for the past few weeks and added two commits to improve it. The integration with oauth2-proxy is seamless!
Description
Configurable
logoutPageThe logout button is hidden when proxy auth is used (re: #934) because, at the time, logging out of oauth2_proxy cannot be done in filebrowser.
oauth2_proxy has since been updated to call the upstream auth provider's logout method, re: oauth2-proxy/oauth2-proxy#1876. filebrowser requires changes before this feature can be used:
logoutPageURL to filebrowser settingslogoutPageis not set default (ie./login)Example:
set a custom
logoutPagefor filebrowserrun oauth2-proxy with custom logout URL (for keycloak)
Token renewal after expiration
Users with proxy auth and a custom logout page are likely to encounter friction with filebrowser's default token renewal mechanism. The lifetime of session/renewal tokens issued by an auth proxy will conflict with filebrowser's JWT, prematurely logging out the user. To mitigate this issue the filebrowser token may be renewed after expiration if, and only if, the following conidtions are met:
Validate token 'alg'
The golang-jwt/jwt/v4 library strongly encourages that the implementer validate the token 'alg'. From the documentation:
In light of the fact that this request makes it possible to renew expired tokens under specific circumstances, it makes sense to also ensure all JWT security guidance is strictly adhered to.
🚨 Before submitting your PR, please indicate which issues are either fixed or closed by this PR. See GitHub Help: Closing issues using keywords.