Hey, so it should be retrieving the user details at that point but it’s getting something else back from Nextcloud.
I’m just pushing an update now that will better log the response, so if you could update the plugin to v1.1 and in WP go to Settings -> “Nextcloud OAuth2” and tick the new “Enable debug log” and then Save Changes.
Then try and login again with Nextcloud, then if you could send the contents of the new file over (it should be in your uploads folder) it should give me a bit more information as to what’s gone wrong.
*laughs*
Well, the content of the debug log is quite wonderful :
[2022-02-25 10:13:00] Unrecognised response when requesting Nextcloud user data, response:
[2022-02-25 10:19:00] Unrecognised response when requesting Nextcloud user data, response:
😀
Is there something wrong in the debug mode, or in my installation ?
Yeah, that’s extremely helpful haha, It’s getting nothing back from Nextcloud that’s why it’s blank, what version of Nextcloud are you using?
It should be getting the URL /index.php/ocs/v2.php/cloud/user?format=json which should return the username, email etc.. I did see on quite a few posts when building it, that some Nextcloud versions were a bit hit and miss with that URL.
Hey, leave it with me, I have only tested it with 23.0.0, I’ll get a copy of 20.0.14 and see if I can figure out why!
thank you very much 🙂
I’m behind versions because my mySQL version is old (5.7.35-0ubuntu0.18.04.2) and currently I can’t update it
Hey, if you update to v1.2 it should be all sorted!
Yes it does, thank you so much !!
Well, it ALMOST works, now
If I try to connect an user known in WP and Nextcloud : it works \o/
If I try to connect an user unknown in WP, I have a message :
User has been disabled in Nextcloud
The user is absolutely not disabled… Again, did I do womething wrong ?
Thank you !
Hey, I’m not sure about that one, just double-check the user is enabled please.
Other than that potentially I think the older version of Nextcloud might return data slightly differently. If you could go into the plugin file:
/wp-content/plugins/tims-nextcloud-sso-oauth2/includes/functions.php
And on line 105 change:
if($nextcloud_user->ocs->data->enabled == '1'){
to:
if($nextcloud_user->ocs->data->enabled){
I think the older version of Nextcloud might return a true value as the new one a 1 value.
Let me know if that sorts it and I’ll get the plugin updated.
Ouch, it doesn’t seem to work either…
and I triple checked 😉 It’s not disabled…
Hey, replace the plugin with this one: https://www.filemail.com/d/zowkrpysvxndhqb and enable debug again and try to login, you may want to email me the log output directly at tim@oxendale.net as it will contain some sensitive info.
I have updated the plugin to be compatible with older versions of Nextcloud, and thanks for the review!