docker icon indicating copy to clipboard operation
docker copied to clipboard

Login Screen Loop

Open MartinEnders opened this issue 5 years ago • 9 comments

Hi,

when I was setting the redis connection parameters in docker-compose file it resulted in a login-loop. When I logged in I have been redirected to the login-page immediatly. Setup: everything in docker, nginx reverse proxy in front of apache-20 version of nextcloud

When I removed the redis-config from the environment it worked fine (s. link below). I assume that redis is working because it is inserted in the config.php file.

https://help.nextcloud.com/t/login-loop-after-updating-dockerized-nextcloud-to-version-19/88705/3

Now my nextcloud setup works fine.

Best regards Martin

MartinEnders avatar Oct 12 '20 15:10 MartinEnders

fixed in #1232

J0WI avatar Nov 07 '20 00:11 J0WI

This issue is not fixed. After pulling the latest stable version I was still able to recreate the issue. The issue #1232 is not the same problem because that issue was caused by leaving the password blank. This problem here is caused by having the password filled in and by doing so, causing a loop.

briancsimonsen avatar Nov 09 '20 15:11 briancsimonsen

I faced the same problem, however I have a workaround and a hint to possible problem.

  • So, after clean install via docker and creating admin user - login screen was looping. This was done in a web-browser on a PC, pointing to the local installation (http://192.168.0.100:8080)
  • I configured a reverse proxy (nginx) with LetsEncrypt certificate for it, being accessible at https://nextcloud.example.com. And it works! (this is a workaround part)
  • I tried to configure official Android app to contact my server via a domain name.... And the app also has a login loop, however, it also shows an error Strict mode: no http connection allowed. (this is a hint part). But I'm not sure how to fix it. I'd like to move all the installation onto the HTTPS - even local access, but I can't find any manual how to do it using (official) docker install

Shurov avatar Jul 17 '21 21:07 Shurov

I found this issue since Shurov's comment has the issue I was searching for regarding the android app. I have a similar setup using caddy to make everything go through https.

I was able to solve the issue by adding 'overwriteprotocol' => 'https' to my config.php file. This forces it to use https since it doesn't actually know it's being set to https via the reverse proxy.

I don't know if this has anything to do with the original issue, but since I found my way here through a web search I figured someone else might too.

Rebanar avatar Aug 18 '21 00:08 Rebanar

That workaround isn't ideal, as it would allow any connections not being made through https for whatever reason. If you're using that I would suggest having your reverse proxy only accept HTTPS and redirect everything attempting to use HTTP.

For a perminant solution, Nextcloud would need to add support for the X-Forwarded-Proto header

girlpunk avatar Sep 09 '21 08:09 girlpunk

Agreed, this is currently not fixed

BartAgterbosch avatar Oct 08 '21 16:10 BartAgterbosch

Still have this issue here too.

hynet-mel avatar Oct 14 '21 15:10 hynet-mel

Same shit here! Rebanar solution fixed it! Thanks!

adding 'overwriteprotocol' => 'https' to config.php

dR3b avatar Nov 05 '21 07:11 dR3b

Hey!

I'm on unraid 6.9.2 with Nextcloud Hub II (23.0.3) as Docker (20.10.5) behind a pfSense 2.6.0 with haproxy (0.61_5) and had the same Problem. Logins from the same subnet went good, but external login ended in looping the login after input of username and password. Different changes in nextcloud's config.php (trustetd:domains, overwrite.cli.url, overwriteprotocol, trusted_proxies, forwarded_for_headers an so on) does not solve the problem.

my solution: in haproxy simply redirect FQDN port 80 and port 443 at the frontend to one backend at port 443 with valid certificates.

Chlorgas avatar Apr 11 '22 16:04 Chlorgas