[FIX] Nextcloud as custom oauth provider wasn't mapping data correctly#10090
[FIX] Nextcloud as custom oauth provider wasn't mapping data correctly#10090rodrigok merged 3 commits intoRocketChat:developfrom
Conversation
This is the [schema](https://docs.nextcloud.com/server/13/developer_manual/client_apis/OCS/index.html) of the response (you can ask json instead of xml).
|
@pierreozoux why did you choose to not stick to the OpenID specification and forced the owncloud/nextcloud own specficiation upon rocket chat? Adding the necessary endopoint to owncloud/nextcloud is rather easy - feel free to have a look at owncloud/oauth2#115 |
|
@DeepDiver1975 thanks for the hint. To be honest, I'm not a developer, I'm more on developing hosting infrastructure, so I'm always looking to develop the least. And when I code, I prefer js :) On GitLab or Discourse, it was easy to configure, so I though, I'd do the little correction for Rocket and it is all I need for now. I still think that this should be configurable on Rocket too, (the way it is configurable on GitLab), but this is another topic. |
|
IMHO, in terms of clean code, stick to a common specification and forcing it is much better than defining exceptions for different projects. |
|
Hi @pierreozoux, It seems to me that the mapping you did does not work for some reason. It seems your code never get executed. I have the latest snap installation (0.73.2) and i double checked and your update is there. When using NextCloud as an oauth provider, I do not get the ocs.data.displayname copied to the newly created RocketChat account. If i point the username field in the Custom OAuth configuration panel to "ocs.data.id", the displayname is ignored. I thought maybe your code will be executed when I leave the username field empty empty. However, in that situation I found out, RocketChat asks new users to define a username and still ignores the displayname from NextCloud (and appearently it also ignores then the id too). |
This is the schema of the response (you can ask json instead of xml).
@RocketChat/core