Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

Forgot Password "try again within your home network" #12

Closed
DER31K opened this issue Apr 24, 2020 · 13 comments
Closed

Forgot Password "try again within your home network" #12

DER31K opened this issue Apr 24, 2020 · 13 comments

Comments

@DER31K
Copy link

DER31K commented Apr 24, 2020

This bug is not the fault of the jf-accounts tool, since the "bug" is actually a result of jellyfin feature/design, but how are others getting around jellyfin's reluctance to reset password when connecting via reverse proxy?

Have you just convinced Jellyfin that all traffic coming via your proxy is local traffic?
Is there a hidden setting somewhere in Jellyfin that enables password reset even on remote connections?

image

@hrfee
Copy link
Owner

hrfee commented Apr 24, 2020

This doesn't appear for me personally, and it appears my reverse proxy (nginx) is set up correctly, as Jellyfin reports granting access from my phone's IP when testing on mobile data. What does your networking tab look like in jellyfin? Here's mine:
networking

@hrfee
Copy link
Owner

hrfee commented Apr 24, 2020

Do you have anything in the LAN networks box? I think by leaving it blank, it treats all connections as local.

@DER31K
Copy link
Author

DER31K commented Apr 24, 2020 via email

@hrfee
Copy link
Owner

hrfee commented Jun 8, 2020

Did you ever figure this out? If so i'd like to add it to the wiki.

@hrfee
Copy link
Owner

hrfee commented Jun 8, 2020

It also just occured to me that putting 0.0.0.0/32 in the LAN networks setting would probably make jellyfin treat all connections as local, although I still don't understand why i don't have the same issue.

@DER31K
Copy link
Author

DER31K commented Jun 8, 2020

No sorry, I did not figure this out.
I ended up just removing the forgot password button via custom CSS.

Not a real solution... as It'd be great for remote users to still be able to reset their password; but I think the only way to get around this is to convince Jellyfin into believing that all remote connections are local, as you suggested - but doing that has some implications on other aspects of how Jellyfin operates (ie bandwidth limits for remote connections)

As for why you aren't seeing the same issue, likely its in your reverse proxy setup.
If Jellyfin is seeing the local IP of your reverse proxy host, Jellyfin would assume the connection is local as opposed to the actual remote origin.

@ElevonsJKeloids
Copy link

I had the same issue. I was able to get Jellyfin to consider all networks as local by setting the LAN networks to 0.0.0.0/0

@hrfee
Copy link
Owner

hrfee commented Sep 2, 2020

Ah ok, a zero for the cidr at the end makes more sense. I'll add this to the wiki.

@hrfee hrfee closed this as completed Sep 2, 2020
@kuantek
Copy link

kuantek commented Nov 29, 2020

The problem with this approach is that remote connections won't be rate limited. All connections will appear local and will bypass all remote connection limitations.

Ideally, there should be a way to allow forgot password to be accessed from remote connections.

@hrfee
Copy link
Owner

hrfee commented Nov 29, 2020 via email

@kuantek
Copy link

kuantek commented Nov 29, 2020

That doesn't seem to work for me. I have nginx running on the same server and passing traffic to the localhost from the localhost. I have the proxy headers set and tcpdump is showing that they are working correctly, but jellyfin is seeing everything as coming from local.

Capture

@hrfee
Copy link
Owner

hrfee commented Dec 2, 2020

@kuantek This setup seems to work for me, remote bandwidth limits and everything. It seems even if the reverse proxy IP is included in the 'known proxies' setting, access from it is treated as local unless X-Forwarded-For/X-Real-IP is set.

nginx.conf

...
    location /Users/ForgotPassword {
        proxy_pass http://<jf-ip>:8096/Users/ForgotPassword;
        proxy_set_header Host $host;
    }

    location /Users/ForgotPassword/Pin {
        proxy_pass http://<jf-ip>:8096/Users/ForgotPassword/Pin;
        proxy_set_header Host $host;
    }
...

networking settings
networking settings

@kuantek
Copy link

kuantek commented Dec 2, 2020

Yeah, I think my issue is that I don't have that known proxies option in the settings on my jellyfin server. This is how I have the traffic setup now, I have the proxy SSL offloading on the localhost to keep traffic encrypted, the X-Real-IP and X-Forwarded-For are both appearing correctly, but the traffic is still not being denied. Because I don't have an exception for the password portion, I shouldn't be able to reset passwords externally with this setup, but I can.

    location / {
        proxy_pass http://127.0.0.1:8096;
        proxy_pass_header  Set-Cookie;

        proxy_set_header  Host  $host;
        proxy_set_header  X-Real-IP       $http_x_forwarded_for;
    }

This pcap was captured on localhost after ssl offloading:
image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants