# Cannot grant access

**URL:** <https://help.nextcloud.com/t/cannot-grant-access/64566>\
**Category:** 💻 Desktop\
**Created:** [November 20, 2019, 7:22am UTC](https://help.nextcloud.com/t/cannot-grant-access/64566 "2019-11-20T07:22:11Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![raghnarok](https://help.nextcloud.com/user_avatar/help.nextcloud.com/raghnarok/32/19170_2.png) [@raghnarok](https://help.nextcloud.com/u/raghnarok)\
**Post date:** [November 20, 2019, 7:22am UTC](https://help.nextcloud.com/t/cannot-grant-access/64566/1 "2019-11-20T07:22:11Z")

</div>

Hello,

I have a Nextcloud server running since some time now, everything working fine until two days ago.  
As far as I can see, everything is working except the connection with the Nextcloud desktop app.  
When I add a new account (I did that because I thought it could help me in my problem), the app send me to the login page, which is working, then the “Grant access” page, which does nothing. I can click on the “Grant access” button but it’s useless.  
I’ve tried this process with Firefox, Chromium and Edge, nothing change. I’ve also tried on Debian and on Windows 10, same problem.

Nextcloud version : 17.0.1  
OS : Debian Buster with some parts of Bullseye  
Apache : 2.4.38  
PHP : 7.3.11-1

I’ve check the access.log and error.log, nothing seems to be relevant to this problem.

Can someone help me?

---

<div class="post-metadata">

**Author:** ![raghnarok](https://help.nextcloud.com/user_avatar/help.nextcloud.com/raghnarok/32/19170_2.png) [@raghnarok](https://help.nextcloud.com/u/raghnarok)\
**Post date:** [November 20, 2019, 9:41am UTC](https://help.nextcloud.com/t/cannot-grant-access/64566/2 "2019-11-20T09:41:48Z")

</div>

Ok, I think I have the solution.  
When I’m on the “Grant access” page, my firefox consol says:  
` Content Security Policy: The page’s settings blocked the loading of a resource at http://cloud.vulgarisons.info/index.php/login/v2/grant (“form-action”).`

The problem seems to be related to my new Haproxy installation.  
I had to add `overwriteprotocol => "https"`

Thanks to Tiontion24 on #debian-facile for the help.

---

<div class="post-metadata">

**Author:** ![jsschmid](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jsschmid/32/19577_2.png) [@jsschmid](https://help.nextcloud.com/u/jsschmid)\
**Post date:** [December 7, 2019, 12:42pm UTC](https://help.nextcloud.com/t/cannot-grant-access/64566/3 "2019-12-07T12:42:20Z")

</div>

Same issue here and your solution worked as well.  
Should this reported as an issue or could it be some server misconfiguration?  
http instead of https is uncommon!

---

<div class="post-metadata">

**Author:** ![SmallOne](https://help.nextcloud.com/user_avatar/help.nextcloud.com/smallone/32/5326_2.png) [@SmallOne](https://help.nextcloud.com/u/SmallOne)\
**Post date:** [December 7, 2019, 2:05pm UTC](https://help.nextcloud.com/t/cannot-grant-access/64566/4 "2019-12-07T14:05:42Z")

</div>

If one is using a proxy before like ha proxy you usually have http between the proxy and the webserver. Thus creating a problem. You need to know how to configure that in that case. This is a configuration error and not an issue.

---

<div class="post-metadata">

**Author:** ![jsschmid](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jsschmid/32/19577_2.png) [@jsschmid](https://help.nextcloud.com/u/jsschmid)\
**Post date:** [December 7, 2019, 3:58pm UTC](https://help.nextcloud.com/t/cannot-grant-access/64566/5 "2019-12-07T15:58:13Z")

</div>

I didn’t use a proxy though…  
And even I would have, which I do from time to time on Firefox: I tried different browsers, the same result with all of them. And surely I didn’t touch the windows proxy settings.

---

<div class="post-metadata">

**Author:** ![Djokx](https://help.nextcloud.com/letter_avatar/djokx/32/6_449c533f586939b6e5f246632a46421f.png) [@Djokx](https://help.nextcloud.com/u/Djokx)\
**Post date:** [December 9, 2019, 11:37am UTC](https://help.nextcloud.com/t/cannot-grant-access/64566/6 "2019-12-09T11:37:36Z")

</div>

Same issue here with nextcloud inside a Docker and behind a nginx reverse-proxy. I’ve set `'overwriteprotocol' => 'https'` but it doesn’t solve the issue.

I managed to login with windows desktop app with the old login system, but I can’t log into the macos app.

---

<div class="post-metadata">

**Author:** ![cybertale](https://help.nextcloud.com/letter_avatar/cybertale/32/6_449c533f586939b6e5f246632a46421f.png) [@cybertale](https://help.nextcloud.com/u/cybertale)\
**Post date:** [December 15, 2019, 1:33pm UTC](https://help.nextcloud.com/t/cannot-grant-access/64566/9 "2019-12-15T13:33:38Z")

</div>

I got the same issue. Grant access button is not working. Only android client can connect. iOS win and linux all can not connect. Chrome console says that

> Refused to send form data to ‘’ because it violates the following Content Security Policy directive: “form-action ‘self’”.

---

<div class="post-metadata">

**Author:** ![dg1sek](https://help.nextcloud.com/user_avatar/help.nextcloud.com/dg1sek/32/11031_2.png) [@dg1sek](https://help.nextcloud.com/u/dg1sek)\
**Post date:** [January 9, 2020, 5:10pm UTC](https://help.nextcloud.com/t/cannot-grant-access/64566/10 "2020-01-09T17:10:23Z")

</div>

I have the same issue. On a company provided macbook on which I am not allowed to modify networking/proxy configuration, I’m completely blocked for the installation of the nextcloud client due to this.  
IMHO this is a bug in the client, because there’s simply nothing happening when you press the button, no error message, nothing.

---

<div class="post-metadata">

**Author:** ![xyz-Mann](https://help.nextcloud.com/user_avatar/help.nextcloud.com/xyz-mann/32/15234_2.png) [@xyz-Mann](https://help.nextcloud.com/u/xyz-Mann)\
**Post date:** [January 10, 2020, 8:42pm UTC](https://help.nextcloud.com/t/cannot-grant-access/64566/11 "2020-01-10T20:42:29Z")

</div>

i 've got the same problem!  
last time i used an older client to login but that doesn’t work anymore…

grant access is doing nothing…

server: 17.0.2  
client: 2.6

i am using nextcloud as docker with letsencrypt companion docker and nginx reverse proxy docker

‘overwriteprotocol’ =\> ‘https’ does not help

please help us!

---

<div class="post-metadata">

**Author:** ![yassine](https://help.nextcloud.com/user_avatar/help.nextcloud.com/yassine/32/20537_2.png) [@yassine](https://help.nextcloud.com/u/yassine)\
**Post date:** [January 20, 2020, 8:09pm UTC](https://help.nextcloud.com/t/cannot-grant-access/64566/12 "2020-01-20T20:09:36Z")

</div>

Hello All,

to solve this issue you need to add ‘overwriteprotocol’ =\> ‘https’ in config/config.php in nextcloud, I tested and solving the issue, here the explaination

/\*\*

- When generating URLs, Nextcloud attempts to detect whether the server is
- accessed via `https` or `http`. However, if Nextcloud is behind a proxy
- and the proxy handles the `https` calls, Nextcloud would not know that
- `ssl` is in use, which would result in incorrect URLs being generated.
- Valid values are `http` and `https`.  
\*/  
‘overwriteprotocol’ =\> ‘’,

---

<div class="post-metadata">

**Author:** ![Robertoal](https://help.nextcloud.com/user_avatar/help.nextcloud.com/robertoal/32/20397_2.png) [@Robertoal](https://help.nextcloud.com/u/Robertoal)\
**Post date:** [February 18, 2020, 10:54am UTC](https://help.nextcloud.com/t/cannot-grant-access/64566/13 "2020-02-18T10:54:45Z")

</div>

**EDIT: Installed the 18.0.0.3 docker and added:**  
**‘overwriteprotocol’ =\> ‘https’,**  
**Which indeed did work!**

I have the same problem:

Behind an Nginx reverse proxy; and no app works. When adding overwriteprotocol https nothing works anymore. which is logical I gues because: nextcloud -\> nginx is http…

Any solution to this?

[edit] Strangely: it did work before installing two factor authentication… but now after uninstalling it; it still doesn’t work. [/edit]

---

<div class="post-metadata">

**Author:** ![johanwallenborg](https://help.nextcloud.com/letter_avatar/johanwallenborg/32/6_449c533f586939b6e5f246632a46421f.png) [@johanwallenborg](https://help.nextcloud.com/u/johanwallenborg)\
**Post date:** [March 5, 2020, 9:16pm UTC](https://help.nextcloud.com/t/cannot-grant-access/64566/14 "2020-03-05T21:16:01Z")

</div>

I’m running nextcloud in docker containers and finally got this too work.

Upgraded to 18.01 and then added following to config/config.php

‘overwriteprotocol’ =\> ‘https’,

---

<div class="post-metadata">

**Author:** ![p3palazzo](https://help.nextcloud.com/user_avatar/help.nextcloud.com/p3palazzo/32/12645_2.png) [@p3palazzo](https://help.nextcloud.com/u/p3palazzo)\
**Post date:** [March 30, 2020, 9:02pm UTC](https://help.nextcloud.com/t/cannot-grant-access/64566/15 "2020-03-30T21:02:08Z")

</div>

`'overwriteprotocol' => 'https'` does not work when Nextcloud is running behind a reverse proxy. The system returns:

> Content Security Policy: The page’s settings blocked the loading of a resource  
> at [http://wherever.com](http://wherever.com) (“form-action”).

Editing the trusted domains and trusted proxies settings in config.php does not work, either.

Still waiting for a solution on this one.

---

<div class="post-metadata">

**Author:** ![Mr.Gosh](https://help.nextcloud.com/user_avatar/help.nextcloud.com/mr.gosh/32/23125_2.png) [@Mr.Gosh](https://help.nextcloud.com/u/Mr.Gosh)\
**Post date:** [March 31, 2020, 7:41am UTC](https://help.nextcloud.com/t/cannot-grant-access/64566/16 "2020-03-31T07:41:46Z")

</div>

I still have the same problem here with nextcloud in docker behind a traefik2 in docker.  
There really is a error message missing.  
I will try to add 'overwriteprotocol’ =\> ‘https’ to my docker-compose file - i’ll report if that helps.

---

<div class="post-metadata">

**Author:** ![Mr.Gosh](https://help.nextcloud.com/user_avatar/help.nextcloud.com/mr.gosh/32/23125_2.png) [@Mr.Gosh](https://help.nextcloud.com/u/Mr.Gosh)\
**Post date:** [March 31, 2020, 11:54am UTC](https://help.nextcloud.com/t/cannot-grant-access/64566/17 "2020-03-31T11:54:02Z")

</div>

yeah - that worked but how to Integrate this into a docker-compose file

---

<div class="post-metadata">

**Author:** ![Karon\_Shell](https://help.nextcloud.com/letter_avatar/karon_shell/32/6_449c533f586939b6e5f246632a46421f.png) [@Karon\_Shell](https://help.nextcloud.com/u/Karon_Shell)\
**Post date:** [April 5, 2020, 3:34pm UTC](https://help.nextcloud.com/t/cannot-grant-access/64566/18 "2020-04-05T15:34:00Z")

</div>

Big trouble whith the “grant acces” procedure from the 2.5.XX version of th client on Debian Buster.  
Adding the PPA won’t work since the last version will only be available for xenial distros.  
had to compile from source the 2.7.xx with no difficulty at all.  
Work’s very well !  
Please publish some adapted ppa 😉

---

<div class="post-metadata">

**Author:** ![superdriftking](https://help.nextcloud.com/letter_avatar/superdriftking/32/6_449c533f586939b6e5f246632a46421f.png) [@superdriftking](https://help.nextcloud.com/u/superdriftking)\
**Post date:** [April 12, 2020, 10:41am UTC](https://help.nextcloud.com/t/cannot-grant-access/64566/19 "2020-04-12T10:41:54Z")

</div>

I’m having the same issue and overwrite and trusted configs do not work. In a desktop browser I have to refresh the the tab to login as I get the ‘Content Security Policy’ error messge. In the iOS app I’m stuck on the grant access screen as it does not redirect.

---

<div class="post-metadata">

**Author:** ![andersot](https://help.nextcloud.com/user_avatar/help.nextcloud.com/andersot/32/23949_2.png) [@andersot](https://help.nextcloud.com/u/andersot)\
**Post date:** [April 19, 2020, 4:13pm UTC](https://help.nextcloud.com/t/cannot-grant-access/64566/20 "2020-04-19T16:13:32Z")

</div>

Just wanted to say thanks - this solved my ios issues. Just completed installing via k8s and I was oh no why isn’t this working. excellent forum thanks y’all 😀

---

<div class="post-metadata">

**Author:** ![jcrombez](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jcrombez/32/24581_2.png) [@jcrombez](https://help.nextcloud.com/u/jcrombez)\
**Post date:** [May 4, 2020, 1:52pm UTC](https://help.nextcloud.com/t/cannot-grant-access/64566/21 "2020-05-04T13:52:38Z")

</div>

Editing a config.php file is not possible on my docker servers, everything is stateless regarding nextcloud itself.  
I tried using the documented environment variable “ **OVERWRITEPROTOCOL** ” (set to https) but with no difference.

---

<div class="post-metadata">

**Author:** ![p3palazzo](https://help.nextcloud.com/user_avatar/help.nextcloud.com/p3palazzo/32/12645_2.png) [@p3palazzo](https://help.nextcloud.com/u/p3palazzo)\
**Post date:** [June 14, 2020, 1:08pm UTC](https://help.nextcloud.com/t/cannot-grant-access/64566/22 "2020-06-14T13:08:37Z")

</div>

Currently, a possible workaround to the “cannot grant access” problem is to use the OwnCloud desktop client.

[Next page](https://help.nextcloud.com/t/cannot-grant-access/64566.md?page=2)
