Cannot grant access

Hi there, I am unable to solve this issue, this is so weird. On my laptop, I managed to solve the issue by adding 'overwriteprotocol' => 'https'. However, on my phone I had to use a QR code (app password) to authenticate.

Now, I want to sync my desktop computer. 'overwriteprotocol' => 'https' doesn’t help. So I had the idea to try using an app password (as I did for my phone) but I have a very weird bug. In the browser, I have an error message telling me that the username or the password is wrong BUT in the page where I created the app password I can see a successful authentication in the list of sessions (“Devices & sessions”). Because of that, I cannot use the same trick as on my phone and I am truly unable to grant access to my desktop computer.

I saw some people mentioning that having a reverse-proxy makes a difference and that the overwriteprotocol trick doesn’t work in this case. In my particular case, I use Traefik. Is there someone who had to deal with this issue while using Traefik? Can someone please help me? It’s driving me crazy :sweat_smile:

Or maybe, as several people are unable like me to solve this issue, should we open an issue on Github?

Hi again :wink: I found a hack to bypass the issue. It is not a fix but it allowed me to authenticate for this one time. I think it might be helpful for people who are unable to fix the issue with overwriteprotocol, so I will try to explain what I did there.

In the browser window (I use Firefox), instead of clicking on the “Grant Access” button, right click on the button and “Inspect”. In the HTML source, look for the URL of your server. Basically, the button is programmed to execute a POST request using this URL. The problem is that the URL starts with “http” instead of “https”. Now, right click on the code and “Edit As HTML”. Add a “s” manually so that the URL looks like “https://”.

Now, click on the “Grant Access” button. As you edited the URL, the POST request will use the right protocol and it should work :slightly_smiling_face:

If I understood well, overwriteprotocol is supposed to replace “http” with “https”. My hack consists in doing this job manually, basically :sweat_smile:

I hope it will be helpful :slightly_smiling_face:

Thanks, this did the trick for me as well!

Removed the Header and now iOS works! :+1:

This “overwriteprotocol’ => ‘https’”
also fixed it for nextcloud snap, had to edit /var/snap/nextcloud/*/nextcloud/config/config.php

1 Like

worked for me too. I had problem with floccus (bookmark sync between devices). I am using nc22.

Hello,

i have the same problem and nothing that is describe here and in official docs helped me.

My nextcloud is in docker with the nginx reverse proxy companion. In adition i use ipv6 AND ipv4.
In the nextcloud backend i get the warning message:

Du greifst ĂŒber eine sichere Verbindung auf deine Instanz zu, deine Instanz generiert jedoch unsichere URLs. Dies bedeutet höchstwahrscheinlich, dass du dich hinter einem Reverse-Proxy befindest und die Konfigurationsvariablen zum Überschreiben nicht richtig eingestellt sind. Bitte lese die Dokumentation hierzu :arrow_upper_right:.

But everything is defined like in the documentation described.
My config looks like that:

'trusted_proxies' => 
  array (
    0 => '172.19.0.3/16',
    1 => 'fd00:0:2::3/48',
  ),
  'trusted_domains' => 'nextcloud.example.com',
  'overwritehost' => 'nextcloud.example.com',
  'overwriteprotocol' => 'https',
  'overwrite.cli.url' => 'https://nextcloud.example.com',

Are there any different options i forgot?

maybe an aditional question:

which config.php file is used from nextcloud in docker?
That one from /usr/src/nextcloud/config/ or from /var/www/html/config?

And where is the reverse-proxy.config.php loaded from because this one would migrate env variables from docker to the instance.

Acutally i’ve hard coded my configuration in /var/www/html/config/config.php.
But the nice way would be the docker env.

i think i’ve found the issue.
I already set docker-env variables but i used " ’ " for the string-values instead just combine key=value without ‘’.

Thanks.

If the problem has to do with Nextcloud playing nice with a reverse proxy server, as was my case, then in addition to overwriteprotocol you may want to try adding a line for overwritehost, which fixed my problem. Per the config.sample.php file:

  • The automatic hostname detection of Nextcloud can fail in certain reverse
  • proxy and CLI/cron situations. This option allows you to manually override
  • the automatic detection; for example www.example.com, or specify the port
  • www.example.com:8080.

‘overwritehost’ => ‘’,