# RocketChat User Authentication for Nextcloud

**URL:** <https://forums.rocket.chat/t/rocketchat-user-authentication-for-nextcloud/12698>\
**Category:** Community Support\
**Created:** [November 26, 2021, 10:36am UTC](https://forums.rocket.chat/t/rocketchat-user-authentication-for-nextcloud/12698 "2021-11-26T10:36:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![syndicat](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/syndicat/32/3319_2.png) [@syndicat](https://forums.rocket.chat/u/syndicat)\
**Post date:** [November 26, 2021, 10:36am UTC](https://forums.rocket.chat/t/rocketchat-user-authentication-for-nextcloud/12698/1 "2021-11-26T10:36:16Z")

</div>

### Description

We set up RocketChat (RC) with internal Authentication / User Management.  
Now - few weeks later - i try to connect Nextcloud (NC) to it by OAuth, so RC users can login into NC with their RC credentials too.

We did so far:

- set up a OAuth App for our NC instance in RC
- installed “Social Login” on NC and set up OAuth2 with the RC Server

On NC, after clicking on Rocketchat, loggin in to RC and click to “allow”, RC leads back to NC, but  
NC throws thhe error:

“Can not get identifier from provider”

It seems the “authorization state” is provided and consumed, but NC expects some kind of further “indentifier” from RC?..

Any ideas / experiences / hints with this or such a setup? I know this is probably more NC related (will ask there too), but no clue so far.

Is OAuth2 (NC “Social Login”) the right way to do that?

Any help or hint is very welcome.

many thanks,

niels.

### Server Setup Information

- Version of Rocket.Chat Server: 3.18.3
- Operating System: Gentoo Linux
- Deployment Method: snap
- Number of Running Instances: 1
- DB Replicaset Oplog: 232
- NodeJS Version: v12.22.1
- MongoDB Version: 3.6.14 / wiredTiger (oplog active)
- Proxy: nginx
- Firewalls involved: pfSense / FreeBSD (NAT / port forwading)

### Any additional Information

nothing in the logs of RC nor RC

In RC:  
Redirect URL: \*ttps://nextcloud.yxz/apps/sociallogin/custom\_oauth2/rchat  
Auth URL: \*ttps://rchat.xyz/oauth/authorize  
Access token: \*ttps://rchat.yxz/oauth/token

In NC (Social Login):  
OAuth2  
API base URL: \*ttps://rchat.yxz/oauth  
Authorize URL: \*ttps://rchat.yxz/oauth/authorize  
Token URL: \*ttps://rchat.xyz/oauth/token  
Profile URL: \*ttps://rchat.yxz/oauth/userinfo (???)  
Client ID: xxxx (ID from RC)  
Client Secret: xxxxx (secret from RC)  
Scope (optional): (empty)  
Profile Fields (optional): (empty)  
Groups Claim (optional): (empty)  
Default Group: “staff”
