Rocket.chat: Custom user information is not received from OAuth

Created on 4 Dec 2019  路  10Comments  路  Source: RocketChat/Rocket.Chat

Description:

We have our own OAuth server and need to get some user information from OAuth (like phone and customer id) and display it on the user info page.

Steps to reproduce:

  1. Go to 'Accounts' and set this items in 'Custom Fields to Show in User Info':
    [{"CustomId":"#{CustomId}"}, {"phone":"#{phone}"}]
  2. Go to 'Accounts > Registration > Custom Fields'
  3. Set this json :
    {"phone" :{"type": "text","required": true,"minLength": 0,"maxLength": 12},"CustomId": {"type": "text","required": true,"minLength": 0,"maxLength": 10}}
  4. Set 'Registration Form' to 'Disabled'
  5. Go to 'OAuth'
  6. Create 'Custom OAuth' and set this items in 'Scope':
    openid email profile groups offline_access phone CustomId

Expected behavior:

I was expecting to get phone and CustomId from OAuth and record details in user information.

Actual behavior:

None of the values listed are recorded in user information.

Server Setup Information:

  • Version of Rocket.Chat Server: 2.2.0
  • Apps Engine Version: 1.7.0
  • Operating System: CentOS 7 x64
  • Deployment Method: tar
  • Number of Running Instances: 1
  • DB Replicaset Oplog: Enabled
  • NodeJS Version: 8.15.1
  • MongoDB Version: 4.0.13

Client Setup Information

  • Desktop App or Browser Version: Google Chrome Version 78.0.3904.108 (Official Build) (64-bit)
  • Operating System: Windows 10

Additional context

We want only our customers can register and login in Rocket chat so i set 'Accounts > Show Default Login Form' to 'false' and set 'Accounts > Registration >Registration Form' to 'Disabled'

stale

All 10 comments

I'm on it

@mohsen2hasani models of accounts?

@mohsen2hasani models of accounts?

what do you mean of account model?

@mohsen2hasani models of accounts?

what do you mean of account model?

i mean to say is there a folder called accounts? and is customfields a model? because i couldn't locate these files

Sir, @mohsen2hasani
Are you sure, that your OAuth code on your end is correctly written?

@mohsen2hasani models of accounts?

what do you mean of account model?

i mean to say is there a folder called accounts? and is customfields a model? because i couldn't locate these files

Go to Accounts > Scroll Below > Registration > AT last you will see a big text container which is Custom Fields
x-special/nautilus-clipboard
copy
lol

@carpecodeum

Sir, @mohsen2hasani
Are you sure, that your OAuth code on your end is correctly written?

Yes, i used this oauth in other projects and get data.

@mohsen2hasani
I will try it tomorrow by creating a dummy OAuth API.

Any traction on this? We have a similar use case.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

karlprieb picture karlprieb  路  3Comments

amayer5125 picture amayer5125  路  3Comments

antn89 picture antn89  路  3Comments

Buzzele picture Buzzele  路  3Comments

danpospisil picture danpospisil  路  3Comments