9p4 / jellyfin-plugin-sso

This plugin allows users to sign in through an SSO provider (such as Google, Microsoft, or your own provider). This enables one-click signin.
GNU General Public License v3.0
590 stars 27 forks source link

domain name is wrong. #167

Closed Mrs-Feathers closed 7 months ago

Mrs-Feathers commented 7 months ago

Describe the bug my server is located at media.example.com. but the oidc plugin requests http://media.local as the address, causing the authentication to fail because it shouldn't be using the local address... and i'm unable to find any setting to change this address it requests.. i dont want it to be local address, but the actual url the server operates at. how can i make this happen? i've never logged into the server with media.local before and i have no idea where it's getting that.

To Reproduce Steps to reproduce the behavior:

  1. set up OIDC correctly
  2. try to login using the sso link generated
  3. it fails because its requesting the local address instead of the domain of the server.

Expected behavior instead of media.local it should request media.example.com

Versions (please complete the following information):

Additional context i am requesting to login via https://media.example.com/SSO/oid/p/example?isLinking=true but it comes back as http://media.local/SSO/oid/r/example

9p4 commented 7 months ago

Are you running Jellyfin behind a reverse proxy?

Mrs-Feathers commented 7 months ago

yes i am, is there a specific header i need to use?

9p4 commented 7 months ago

Please refer to https://jellyfin.org/docs/general/networking/#running-jellyfin-behind-a-reverse-proxy

The main things you need to set are X-Real-IP, X-Forwarded-For, X-Forwarded-Proto, X-Forwarded-Protocol, and X-Forwarded-Host. The instructions vary by reverse proxy software.

Mrs-Feathers commented 7 months ago

thank you so much! for users with NPM (unlisted but close to Nginx) instead of a super long nginx config, all that's required to be copypasted into the "advanced section" is

    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-Protocol $scheme;
    proxy_set_header X-Forwarded-Host $http_host;

and it seems to be working now!