Sciebo-RDS / nextcloud-rds

The Sciebo RDS Nextcloud app.
3 stars 0 forks source link

Federated cloud id, used instead of local uid #4

Open mickenordin opened 2 years ago

mickenordin commented 2 years ago

I have been trying to debug some stuff today, the symptom is that the "Getting started button" in RDS does nothing. It seems that from the point of view of Sciebo-RDS the federated cloud id is passed on to RDS from Nexcloud, instead of the local userid:

{'error': 'UserNotFoundError', 'http_code': 500, 'description': '{"type": "User", "data": {"username": "kano@sunet.se@sunet.drive.test.sunet.se"}} not found'}

The above error message is from the log of: layer2-port-service

That means that the username, in this case, is set to: kano@sunet.se@sunet.drive.test.sunet.se instead of what I suspect that it really needs: kano@sunet.se

I have been tryinmg to hardcode the user name in various places in lib/Controller/PageController.php and lib/Controller/RdsApiController.php but without being able to find where it is actually set.

enriquepablo commented 2 years ago

I've made a PR that adds more info to the jwt. This may or may not fix the issue, since I have not reproduced it in my test instance.

If it does not fix the issue, I think that the problem is not in plugin-nextcloud. What the plugin does is, serverside, to put the cloudID in the jwt; and clientside, to use the jwt to login and to make the jwt generally available to rds code.

So, in case the PR does not fix the problem, I would say that either there is a misconfiguration in nextcloud that gets the cloudID through $user->getUID(), or some rds code is misusing the cloudID data.

enriquepablo commented 2 years ago

The question is that with that PR, we are sending the same information as from the owncloud plugin, and the JS code in the nextcloud plugin is identical to that in the owncloud plugin...