Fallenbagel / jellyseerr

Fork of overseerr for jellyfin support.
https://docs.jellyseerr.dev/
MIT License
3.56k stars 223 forks source link

feat(new auth api): add EmbyConnect authentication API #943

Open pXius opened 1 month ago

pXius commented 1 month ago

Description

This PR is to serve as an RFC to add EmbyConnect authentication to Jellyseerr.

If follows the exact flow used when login in via https://emby.media, but creates a JellyfinLoginResponse as the last step using the acquired data.

graph TD
    A{Start flow IF username <br> is an email address <br> && <br> Jellyfin auth failed} --> B[Authenticate towards EmbyConnect <br> with email and password]
    B --> C[Get a list of Emby servers linked to user]
    C --> D{Compare if a linked <br> server matches the Emby <br> instance in Jellyseerr config}
    D -->|No Match| F[Throw No matching server Exception]
    D -->|Match Found| E[Do an authentication exchange with the hosted <br> Emby server to get a local userId and authToken]
    E --> G[Construct a JellyfinLoginResponse object <br> and return to existing Jellyfin auth login flow]

Changes to Code

Notes

Additional Improvements?

To-Dos

Issues Fixed or Closed

pXius commented 1 month ago

@gauthier-th

Thanks for the feedback. I've resolved all comments as requested, please confirm that this solution is acceptable.

pXius commented 1 month ago

@gauthier-th Thanks again for the guidance.

I have resolved the final comment by reverting the baseUrl override in favour of a vanilla fetch() call as requested.

Please let me know if any other changes are required.

pXius commented 2 weeks ago

Hey @gauthier-th Anything outstanding to get this merged?

gauthier-th commented 2 weeks ago

Hey @gauthier-th Anything outstanding to get this merged?

This will be merged, in time. We also need more people reviewing and testing this, as I don't use EmbyConnect.