feat: support OpenID Connect login#1505
feat: support OpenID Connect login#1505michaelhthomas wants to merge 19 commits intoseerr-team:developfrom
Conversation
4394fae to
c30ef6e
Compare
|
PR available for test with the |
c30ef6e to
d6e8c93
Compare
|
It would be an improvement to have the ability to set the id field to something other than email. Jellyfin, which I am also using with OIDC and is the current account provider, does not have an email field, so I use usernames for user ids. I would like for users to be able to have their existing accounts link automatically rather than them needing to go add them or me have to update all their emails. Otherwise, this works great! No issues getting Authentik setup and working. Sign in works perfect once the accounts are linked! Edit: I did have to run the |
|
Since the migration to the new preview-OIDC Docker tag this night, I had to re-add the OIDC provider. After that, it seems that the migrations might not be running correctly or included. When performing an OIDC login, it fails and the following error message can be found :
I've looked in |
We did not update the preview tag yet |
I'm not sure what happened, but the tag on Docker hub was updated 12 hours ago, and this comment : #184 (comment) says the tag has been updated to this PR |
I was wrong. I thought we didn't but apparently @gauthier-th did |
|
Lets us know when you fix the |
#183 (comment) |
Yes but no :-D |
I was wrong again. @gauthier-th did not update the Image after migrations was added. So i was right the first time. We didn't update image yet. Database migrations has been added. |
|
@Zegorax I just updated the preview tag: |
|
Just tested the last preview image Jellyseer starts fine and the db migration seems to work Configured everything in Authentik At first tries I had this message message from Authentik after pushing the new button on jellyseer login screen Because I had tried this as redirect uri : and nothing worked. Then I found this #183 (comment) I thus made another try without specifying a redirect URI in Authentik, and there it worked with my test user in an incognito window. The test user was not existing in Jellyseer and it created it, and logged me in I then made another test with my own admin user, and I got this : Those are the logs (nothing more) So the issue is that it tries to create my user. It fails because it already exists, with that email address The question is, why does it fails (or doesn't do) the lookup for my user email, before deciding to create the user?? Additional question : I am having hard to figure out how this will work with my existing user base. All of them are imported from Jellyfin, and thus none of them have an email address in Jellyseer. If the auth works only with emails and not username, I dont see how it can there be any match for existing users. If no username login is possible, I suppose that to use Authentik login, all of them will have to first login normally in Jellyseer and edit their profile to add their Authentik email. Its a bit annoying when you have several dozens of users. |
I had the same issue, but was able to resolve it by linking my Authentik account to the automatically created Plex user. Once these were linked, I did not get the error anymore. |
|
@michaelhthomas is there a way to have it automatically go to the OIDC login page (Authentik in my case) whenever that is the only available login provider? I could not find a setting for this |
Such a setting doesnt exist (yet) as far as i have seen. Give them some time. |
|
As someone who is clinging on to the old |
|
FYI, the ability to link to an existing account (with the same email) while logging in is planned. It may end up being a separate PR though, this one is quite large as it is. |
|
Also, I've created a discussion for support/issues with the OpenID Connect preview. Please use this discussion for any questions or issues encountered with the OIDC preview and refrain from commenting them here, allowing this PR to be more effective for code review. |
This comment has been minimized.
This comment has been minimized.
Replaces the native fetch() API with axios for all OIDC-related frontend API calls. This improves consistency with other parts of the codebase and simplifies error handling. Addresses seerr-team#1505 (review)
Updates the user settings documentation to be more generic. Instead of stating users can only sign in with their email address, the text now correctly states that they can use their username or email address. This accounts for both local and media server users. Addresses seerr-team#1505 (comment)
Moves the processCallback function from src/utils/oidc.ts directly into the OidcLoginButton.tsx component where it is used. The now-empty oidc.ts utility file has been removed. This improves code co-location as the function is only used in a single place. Addresses seerr-team#1505 (comment)
Adds a check to ensure a user with the same email address does not already exist before creating a new user during an OIDC callback. If a duplicate email is found, the process is aborted with a 409 Conflict error. Addresses seerr-team#1505 (comment)
Deletes the ErrorCallout.tsx file as it is not used anywhere in the codebase. This cleans up dead code from the project. Addresses seerr-team#1505 (comment)
Refactors the form in EditOidcModal to display validation errors manually using a `div` instead of Formik's `<ErrorMessage>` component. This change brings the component's style in line with the established pattern used in other forms throughout the application, improving code consistency. Addresses seerr-team#1505 (comment)
Adds a check to ensure a user with the same email address does not already exist before creating a new user during an OIDC callback. If a duplicate email is found, the process is aborted with a 409 Conflict error. Addresses seerr-team#1505 (comment)
Deletes the ErrorCallout.tsx file as it is not used anywhere in the codebase. This cleans up dead code from the project. Addresses seerr-team#1505 (comment)
Refactors the form in EditOidcModal to display validation errors manually using a `div` instead of Formik's `<ErrorMessage>` component. This change brings the component's style in line with the established pattern used in other forms throughout the application, improving code consistency. Addresses seerr-team#1505 (comment)
When I began this work (almost 4 years ago!), it was based on a similar Overseerr PR, which implemented everything "by hand." I evaluated migrating everything to use a library then, and IIRC considered the Auth0 client library and found it was somewhat coupled to their service and not mature enough for the use-case. Looking at that library now, it seems to have improved significantly, so I may give that another shot. While I did my best to implement within the spec, I would also be more comfortable leveraging a "battle-tested" library than a bespoke implementation. As an update on the status of this PR generally, I am considering closing this and splitting it further into pieces, in hopes that it will be more likely to be reviewed in a timely manner (and also easier for me to keep up-to-date). As part of that work, I may explore a new server implementation using such a library instead of a hand-rolled and likely flawed implementation. |
This is in fact already possible, though admittedly should be better documented. Your example was already almost correct, but |
|
I'd be willing to take up this work, I have a working prototype I'll push in the next couple of days |
Replaces the native fetch() API with axios for all OIDC-related frontend API calls. This improves consistency with other parts of the codebase and simplifies error handling. Addresses seerr-team#1505 (review)
Updates the user settings documentation to be more generic. Instead of stating users can only sign in with their email address, the text now correctly states that they can use their username or email address. This accounts for both local and media server users. Addresses seerr-team#1505 (comment)
Moves the processCallback function from src/utils/oidc.ts directly into the OidcLoginButton.tsx component where it is used. The now-empty oidc.ts utility file has been removed. This improves code co-location as the function is only used in a single place. Addresses seerr-team#1505 (comment)
Adds a check to ensure a user with the same email address does not already exist before creating a new user during an OIDC callback. If a duplicate email is found, the process is aborted with a 409 Conflict error. Addresses seerr-team#1505 (comment)
Deletes the ErrorCallout.tsx file as it is not used anywhere in the codebase. This cleans up dead code from the project. Addresses seerr-team#1505 (comment)
Refactors the form in EditOidcModal to display validation errors manually using a `div` instead of Formik's `<ErrorMessage>` component. This change brings the component's style in line with the established pattern used in other forms throughout the application, improving code consistency. Addresses seerr-team#1505 (comment)
|
Is this implemented in seerr? |
No, this PR is still a draft. |
Gotcha thank you for the hard work you guys put in. |
|
I'm willing to donate/pay to get this feature merged/closed by the end of the month. March 20th is the 1 year mark...for this PR. The original issue was opened Jul 2022... |
Offering payment or donations does not affect whether or when a PR is merged. This project is volunteer-maintained, and reviews are based on technical merit and available time. Also, as noted by the original author, this PR is likely to be reworked or split into smaller pieces to improve reviewability and long-term maintainability. Any next steps will follow from that. Please be respectful of the maintainers' time. |
|
What are the current plans for integrating OIDC into the new master Seerr project? I run my own media service for fam and friends and have used preview-OIDC for quite a while now, I have doubts that migration would be easy. |
|
Closed in favor of #2715 |









Description
Adds long-awaited support for OpenID Connect as a means of logging in to Jellyseerr. This implementation supports adding several third-party OpenID Connect providers to your instance, and allows existing users to link and unlink OpenID Connect accounts from their user accounts. For details on how to configure OpenID Connect, documentation updates are included in this PR.
Screenshot (if UI-related)
Checklist
pnpm buildpnpm i18n:extractIssues Fixed or Closed