# How to connect Rocket chat to Nexcloud using Oauth?

**URL:** <https://forums.rocket.chat/t/how-to-connect-rocket-chat-to-nexcloud-using-oauth/7117>\
**Category:** Community Support\
**Created:** [May 27, 2020, 8:41pm UTC](https://forums.rocket.chat/t/how-to-connect-rocket-chat-to-nexcloud-using-oauth/7117 "2020-05-27T20:41:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yanstv](https://avatars.discourse-cdn.com/v4/letter/y/e68b1a/32.png) [@yanstv](https://forums.rocket.chat/u/yanstv)\
**Post date:** [May 27, 2020, 8:41pm UTC](https://forums.rocket.chat/t/how-to-connect-rocket-chat-to-nexcloud-using-oauth/7117/1 "2020-05-27T20:41:39Z")

</div>

I have problem using Oauth to connect Rocket chat to NextCloud since 3 days.

I have this error on log file

````
```
I20200526-13:18:53.862(2) server.js:204 Meteor ➔ publish null -> userId: null, arguments: [] 
I20200526-13:18:53.877(2) server.js:204 Meteor ➔ method loadLocale -> userId: null, arguments: ["fr"] 
I20200526-13:18:53.936(2) server.js:204 Meteor ➔ method public-settings/get -> userId: null, arguments: [] 
W20200526-13:19:26.649(2) (oauth_server.js:392) Error in OAuth Server: Failed to complete OAuth handshake with nextcloud at http://www.sorghun.com/my_documents/index.php/apps/oauth2/api/v1/token. failed [400] {"error":"invalid_client"}
I20200526-13:19:27.485(2) Exception while invoking method 'login' Error: Failed to complete OAuth handshake with nextcloud at http://www.sorghun.com/my_documents/index.php/apps/oauth2/api/v1/token. failed [400] {"error":"invalid_client"} at CustomOAuth.getAccessToken (app/custom-oauth/server/custom_oauth_server.js:134:18) at Object.handleOauthRequest (app/custom-oauth/server/custom_oauth_server.js:191:26) at OAuth._requestHandlers.<computed> (packages/oauth2/oauth2_server.js:10:33) at middleware (packages/oauth/oauth_server.js:161:5) at /snap/rocketchat-server/1433/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40 
```

````

What does it meam please. All config seems ok.

Thank you

### Server Setup Information

- Version of Rocket.Chat Server: 3.2.2
- Operating System: Linux
- Deployment Method: snap
- Number of Running Instances: 1
- DB Replicaset Oplog:
- NodeJS Version: v12.16.1
- MongoDB Version: 3.6.14
- Proxy: 
- Firewalls involved:
