• Resolved ninalire

    (@ninalire)


    Hello,

    Thank you very much for this plugin !
    I’ve been trying to setup the plugin, everything seems to go smoothly, and then when I try to connect using the button provided, I have an error “Unrecognised response when requesting Nextcloud user data”.

    These are my settings : https://ibb.co/YZyVKR2

    What did I do wrong ?

    Thank you very much again

    • This topic was modified 2 years, 9 months ago by ninalire.

    The page I need help with: [log in to see the link]

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Tim Oxendale

    (@timssolutions)

    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.

    Thread Starter ninalire

    (@ninalire)

    *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 ?

    Plugin Author Tim Oxendale

    (@timssolutions)

    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.

    Thread Starter ninalire

    (@ninalire)

    I’m in 20.0.14

    Plugin Author Tim Oxendale

    (@timssolutions)

    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!

    Thread Starter ninalire

    (@ninalire)

    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

    Plugin Author Tim Oxendale

    (@timssolutions)

    Hey, if you update to v1.2 it should be all sorted!

    Thread Starter ninalire

    (@ninalire)

    Yes it does, thank you so much !!

    Thread Starter ninalire

    (@ninalire)

    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 !

    Plugin Author Tim Oxendale

    (@timssolutions)

    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.

    Thread Starter ninalire

    (@ninalire)

    Ouch, it doesn’t seem to work either…
    and I triple checked 😉 It’s not disabled…

    Plugin Author Tim Oxendale

    (@timssolutions)

    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.

    Plugin Author Tim Oxendale

    (@timssolutions)

    I have updated the plugin to be compatible with older versions of Nextcloud, and thanks for the review!

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Unrecognised response when requesting Nextcloud user data’ is closed to new replies.