feat(networking): implement forward auth#1564
Conversation
|
@fallenbagel @gauthier-th This PR is now ready for review! |
fallenbagel
left a comment
There was a problem hiding this comment.
I didn't fully review this yet but I noticed one issue. The Dockerfile. Also in terms of UI, I would recommend putting the forwardAuth stuff to be indented like how http(s) proxy is done:

Also I would argue that this should be under the advanced networking section as this is not for the normal user. Wdyt about that @gauthier-th
100% agree |
|
@fallenbagel @gauthier-th Applied all the suggestions.
|
a7729d8 to
3c4134f
Compare
|
This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged. |
|
excited for this, would love to setup authentik as the auth for jellyseerr, think this is the way to get that done. |
|
This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged. |
|
Rebased this PR on top of latest develop and fixed a small bug. Ready for review! |
|
This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged. |
|
Thanks @natemccurdy, that was a good observation! It was indeed authenticating every request and setting the user id in session avoids a lot of unnecessary work! edit: Actually @natemccurdy, this change will introduce a bug. Authelia sets a cookie edit: reverted the change since it introduces a bug. |
|
This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
|
3 issues:
In OpenAPIValidator: cookieAuth is the security scheme on every endpoint and the validator runs before the auth middleware, so requests without a session cookie get rejected before forward-auth even has a chance. Fixed like this OpenApiValidator.middleware({
apiSpec: API_SPEC_PATH,
validateRequests: true,
+ validateSecurity: false,
})isAuthenticated() already does the actual auth check, so the validator's cookie requirement is redundant and it breaks any non-cookie auth path (this PR, OIDC in #2715, future API-key flows). @Jycreyn flagged the Can we get also automatic user creation? The lookup uses exact SQL equality on jellyfinUsername. That bites in practice because:
Could the WHERE be case-insensitive? With TypeORM: Edit: I did fixes here, incl auto creation of users: https://github.com/Sapd/seerr/commits/forward-auth-fixes/ |
|
@M0NsTeRRR I have carried forward the work of @ishanjain28 and @Sapd HERE fixing some issues regarding the cloudflare forward auth workflow as well as a bug if the proxy is running a dual stack listener. If the original author does not return I am willing to put in the work to get this over this finish line whether its fixing any actual issues or just resolving the merge conflicts. I have end-to-end tested my current branch and it seems fully functional. |
|
I can take a look at this again on upcoming weekend. |
|
@Xatrekak feel free to open some pull requests on @ishanjain28 fork. That way, he can review your fix and merge it when he has time this weekend. |
…net lib for ip-addr
1. Add comment explaining the trustedProxies setter in server. 2. Reformat header autocompletes and use toLowerCase when checking requests. 3. Remove Advanced Network Settings and restructure settings page.
Add auto provisioning gui
|
This has been rebased with changes from @Xatrekak. I also verified it in my instance, it works correctly. Ready for review! |

Description
This PR adds the Forward Auth feature. It fixes the feedback received in previous attempt here
a. Verify the user field against
jellyfinUsername | plexUsernamecolumns.b. Verify the email field against
emailcolumn.c. Verify both the user and email fields.
How Has This Been Tested?
This has been tested using the included test suite and manually in different environments. Manual test examples,
Screenshots / Logs (if applicable)
Checklist:
pnpm buildpnpm i18n:extractSummary by CodeRabbit
New Features
Documentation
Chores
Tests
Quality