HTTP 401 when I try to grant access to Android client

I’ve set up an instance of nextcloud on a shared hosting environment. I can log on fine to the nextcloud instance from the browser.

I’ve installed the nextcloud app on Android. It asks for the server which I’ve provided:

Connection is fine.

Then it asks me to log on with user ID and password. This works fine.

Then it asks me to grant access:

When I do this, I get HTTP 401 error, and I am sent back to the log in page:

These are the access log entries showing the 401 error: +9qKsQpY+yOBqx+GgSLTkw - - [03/Jan/2021:12:38:27 +0000] "POST /index.php/login/flow HTTP/2.0" 303 - "-" "Motorola motorola one vision (Android)" {910:599,958885} +9qKsQpY+yOBqx+GgSLTkw - - [03/Jan/2021:12:38:29 +0000] "GET /status.php HTTP/1.1" 200 170 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.14.1" {1073:4060,349707} +9qKsQpY+yOBqx+GgSLTkw - - [03/Jan/2021:12:38:29 +0000] "HEAD /remote.php/webdav/ HTTP/1.1" 401 - "-" "Mozilla/5.0 (Android) Nextcloud-android/3.14.1" {155:1123,483111} +9qKsQpY+yOBqx+GgSLTkw - - [03/Jan/2021:12:38:30 +0000] "HEAD /remote.php/webdav/ HTTP/1.1" 401 - "-" "Mozilla/5.0 (Android) Nextcloud-android/3.14.1" {306:1123,416851} +9qKsQpY+yOBqx+GgSLTkw - - [03/Jan/2021:12:38:31 +0000] "GET /index.php/login/flow HTTP/2.0" 200 5037 "-" "Motorola motorola one vision (Android)" {66:5824,620786}

Any suggestions for what to do next?


Hi, I run into the same problem. Did you find solution? Thanks.

Found the issue. My IP was blocked by NC for some reason. Delete the blocked IP fixed the problem.

connect to mysql and run the following query for your IP:
DELETE FROM oc_bruteforce_attempts WHERE ip = 'aaa.bbb.ccc.ddd';

Also have the same problem, trying to figure it out
It’s not a bruteforce problem here

I too am having the same exact problem. There doesn’t seem to be anything helpful in the logs for this and it’s happening to everyone that tries to use the mobile Andriod app. Not sure about the IOS app.
I will say that the app did work for a couple of weeks before I discovered that it stopped working.

Same issue but my error is:

“Access failed: Operation finished with HTTP status code -1 (fail)”

Nothing is out of date and other android apps connect without issue (Talk, Passwords).

This occurs whether it’s an app token or the Grant Access method.

This thread goes back further but I didn’t have issues until the latest update of the app (3.16.0)

yes having the same issue on a fresh install of NC 20 and a freshly installed app on android.
Nothing lets the android app connect to NC.
Although I can connect from the phones browser, but the APP won’t.

If you use Cloudflare with TLS 1.3 downgrade to 1.2 and the app will work again.

1 Like

Thank you, stranger! This worked to fix my issue no problem! Any idea as to why TLS version 1.3 and the current version of Nextcloud don’t get along?

Should be fixed in the next version of the Android client…

Thanks for the clue!