freescout icon indicating copy to clipboard operation
freescout copied to clipboard

oauth nextcloud

Open sebastianPsm opened this issue 1 year ago • 2 comments

Hi,

I'm using the oauth module and it works in general, but the correct user is identified by the email field, and for some reasons the module isn't able to access the right field in the nextcloud user info response. The OAuth module debug log says:

"DEBUG - FreeScout user found by email:"

What I've configured is:

User Info URL: GET https://<domain>/ocs/v1.php/cloud/user Fields Mapping: ocs.data.displayname>>name,ocs.data.email>>email,ocs.data.phone>>phone

I see the correct json response in the debug log and ocs.data.email is correct. But, I may not understand the syntax of "Fields Mapping" correctly. Does someone knows what's wrong with the OAuth Module here?

Thanks in advance Sebastian

sebastianPsm avatar Aug 22 '24 10:08 sebastianPsm

Here comes an example of the User Info Response:

DEBUG - User Info response: {"ocs":{"meta":{"status":"ok","statuscode":100,"message":"OK","totalitems":"","itemsperpage":""},"data":{"id":"xxxxxxxx","lastLogin":1724308307000,"backend":"OCA\UserVO\UserVOAuth","subadmin":[],"quota":{"free":1073653654,"used":88170,"total":1073741824,"relative":0.01,"quota":1073741824},"manager":"","avatarScope":"v2-federated","email":"xxxxxxxxxxxx@xxxxxxxxxx","emailScope":"v2-federated","additional_mail":[],"additional_mailScope":[],"displayname":"Xxxxxxxx Xxxx","display-name":"Xxxxxx Xxxxxxx","displaynameScope":"v2-federated","phone":"xxxxxxxxxxxx","phoneScope":"v2-local","address":"Xxx","addressScope":"v2-local","website":"https://xxxxxxxxxx","websiteScope":"v2-local","twitter":"","twitterScope":"v2-local","fediverse":"","fediverseScope":"v2-local","organisation":"","organisationScope":"v2-local","role":"xxxxxxxxxx","roleScope":"v2-local","headline":"","headlineScope":"v2-local","biography":"xxxxxxx","biographyScope":"v2-local","profile_enabled":"1","profile_enabledScope":"v2-local","groups":["Everyone"],"language":"xx","locale":"","notify_email":null,"backendCapabilities":{"setDisplayName":true,"setPassword":false}}}}

sebastianPsm avatar Aug 22 '24 10:08 sebastianPsm

https://jsonformatter.org/ says something is wrong with your JSON:

2024-08-24_13-24-06

freescout-help avatar Aug 24 '24 10:08 freescout-help

Hi @sebastianPsm

had the same issue. Nextcloud doesn't support a proper UserInfo-JSON. I made a commit to Freescout and you can choose "Nextcloud" as provider in the newest version of the OAuth Plugin. The mapping now works directly on the "ocs.data" array. So just use "user" for "ocs.data.user".

Kind regards ✌️

SteveOswald avatar Jan 13 '25 11:01 SteveOswald