Owncloud client cannot login

Expected behaviour

New install of Owncloud client should prompts requesting for owncloud URL. Owncloud URL is added, oauth2 workflow begins, launch browser window, prompt for authorization. Upon successful authorization, ownCloud client logs in and begins sync.

Actual behaviour

ownCloud client prompts requesting for owncloud URL. Owncloud URL is added, oauth2 workflow begins, launch browser window. Clicking “Authorize” returns error message:

Request not valid
This request is not valid. Please contact the administrator if this error persists.

Steps to reproduce

  1. Running ownCloud server 10.1.0 on Ubuntu 18.04. Oauth2 module version 0.4.1.
  2. On macOs 10.14.5, install ownCloud desktop client v2.5.4
  3. During install & setup, add ownCloud server URL, attempt to authorize.

Server configuration

Operating system: Ubuntu 18.04

Web server: Apache

Database: MySQL

ownCloud version: 10.1.0

Storage backend (external storage): None

Client configuration

Client version: 2.5.4

Operating system: macOS 10.14.5

OS language:English


  1. Client logfile: Output of owncloud --logwindow or owncloud --logfile log.txt
    Client log:

  2. Web server error log:
    Apache log only shows web server restarts

  3. Server logfile: ownCloud log (data/owncloud.log):
    ownCloud server log has not changed in over 1 month

It seems that in the oauth2 module, under Registered Clients, the client is not registered. I tried to re-register the client, using this as the redirection URI:

It added a client, with a generated Client Identifier and Secret. But the client still won’t connect. How do I fix this?

Some additional info, just in case anybody asks:

This ownCloud server has been working for a while, and I have multiple machines connecting to it using the Desktop client just fine. I got a new Macbook Pro, fresh out of the box, installed ownCloud client, and starting having this problem.

1 Like

same trouble +1
And I try to locate trouble, so got a diagnostic logs. But I cant upload logs because I’am new youser here. https://cloud.bitganj.website/index.php/s/Xq8GGdiGPlrXHso


maybe you can try the more recent version 10.2.0 of ownCloud?

Just upgraded the server to 10.2.0. Tried connecting from client again, didn’t work.

Any other possibilities?

I’m thinking its happening because I’m missing an entry in the Oauth settings for the desktop client. I looked in the database:

mysql> select * from oc_oauth2_clients;
| id | identifier   | secret         | redirect_uri              | name    | allow_subdomains |
|  2 | abcdefg12345 | xyzabc12312345 | oc://android.owncloud.com | Android |                0 |
|  3 | 123456712345 | 123abcxyz12345 | oc://ios.owncloud.com     | iOS     |                0 |

It seems to only have Android and iOS, but its missing an entry for the desktop client. I manually made an entry through the OwnCloud web interface for the desktop client and it generated an identifier and secret, but it didn’t match what the client is passing in.

So I looked at the client and what it was passing in. I can see the identifier, but not the secret (makes sense). I manually updated the database with the correct identifier and tried the client again. This time it got further but gave me an error on the secret. SO… what I need to know is… how do I get the secret that the client is passing in, so I can update the database to match?

Anybody else have any suggestions, please? I’m really stuck here.


Check the following link:

and try to register your missing clients with Register new Client in the above link.

Awesome, thank you! I’ll give this a shot later today.

I’m looking at this process and I guess I don’t understand the steps. For “Register New Client”, thats not a CLI command. There is a portion in the UI that allows me to add a new client, which generates a new API Key and Secret. That’s pretty easy to do. But then how do I get my local desktop client to actually use that key? The client seems to be using a key it has decided on.

Or do I need to get the API key and secret from the client and manually add that? How do I get the API key and secret the client is trying to use so I can add it to the system? I can get the key from the authorization URL, but the secret appears to be hidden. Is it in a file stored on the client somewhere?

I guess the core problem is that my ownCloud client has lost its Oauth2 registration inside the ownCloud server. How do I re-register it?

try to reinstall the Oauth2 app, from the market, I’m not sure why your desktop is missing, I just installed the Oauth2 app from the market and Desktop Client is there in the oc_oauth2_clients table.

Ok, thanks, I will try that.

Ok, so I tried it. I was able to reinstall the Oauth2 app. But upon reinstall, the Authorized Users page still only lists the android and ios client, but not the desktop (see screenshot).

I tried to re-authorize the desktop app, but still the same error.

This request is not valid. Please contact the administrator if this error persists.

but first Add client with:
Name: Desktop Client
Redirection URI http://localhost:*

Added but still not working.

Do you see something in the log?

There is nothing showing up in the logs related to this. It simply fails to work.

make sure you use the same client id and secret that the ones used by the desktop client. Using different ones won’t work.

How do I get that? I think I can get the client ID in the URL that is used during authentication. But how do I get the secret?

Oh by the way, I can’t specify the client ID and secret when adding the desktop client to the Oauth screen. It generates one. So either I have to manually update the database with value the client is using (which I need to figure out how to get), or I need to change the client to use the one that is generated in the Oauth settings page.

Seems I’m in a catch 22 here…