lanager icon indicating copy to clipboard operation
lanager copied to clipboard

[Missing documentation] "Failed to validate OpenID login: realm and return_to do not match" behind NPM deployment

Open 0xmex opened this issue 1 year ago • 4 comments

Docker image information

[<system> lanager-docker-compose]# docker images zeropingheroes/lanager
REPOSITORY               TAG       IMAGE ID       CREATED       SIZE
zeropingheroes/lanager   develop   1b07d902aa8e   3 weeks ago   197MB
[<system> lanager-docker-compose]#

Bug description I've set up the LANager and put it behind npm. I can reach the website. But when I am trying to log in, I get an error:

Internal Server Error
The server encountered an unexpected condition which prevented it from fulfilling the request.

When I look into the logs, I'll see this:

[2024-10-17 18:56:43] production.ERROR: Failed to validate OpenID login: realm and return_to do not match {"exception":"[object] (SocialiteProviders\\Steam\\OpenIDValidationException(code: 0): Failed to validate OpenID login: realm and return_to do not match at /var/www/lanager/vendor/socialiteproviders/steam/Provider.php:89)

I've put the https Domain in the .env. It's the same as on npm. But somehow it doesn't get condoned by Steam.

.env:

APP_KEY=base64:<bas64id>
APP_URL=https://play.mydomain.tld
APP_TIMEZONE=Europe/Berlin

STEAM_API_KEY=<mySteamAPIKey>

#TRUSTED_PROXIES=

DB_PASSWORD=<myPassword>
DB_ROOT_PASSWORD=<myPassword>

Reproduction steps

  1. Set up a fresh LANager install
  2. Set up the env as described
  3. Start the site
  4. Initialize it with the script
  5. Put the LANager behind a npm
  6. Access the site through the intended subdomain
  7. Try to log into Steam

Expected behavior Error message as seen above

Bevore posting this, I've played around with the "TRUSTED_PROXIES" variable. When I've added the IP of the npm container it worked as intended. Maybe this needs to be added to the official documentation?

0xmex avatar Oct 17 '24 17:10 0xmex

Hi there, when you say "put it behind npm" can you share more details? I only know npm as the package manager. Thanks

ilumos avatar Oct 17 '24 19:10 ilumos

Hi @ilumos,

npm is the appreviation for nginx proxy manager :)

0xmex avatar Oct 17 '24 20:10 0xmex

Thanks. I've updated the docs with a note about the TRUSTED_PROXIES environment variable:

https://github.com/zeropingheroes/lanager/commit/4543db9be17511fb4fe88fb2403b09f2fdcf1e13

ilumos avatar Jan 07 '25 14:01 ilumos