Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-58714

Return via public WS auth plugins supported by mobile

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. As admin, enable the "Email self registration" auth method in your Moodle installation
      2. Then, place the attached mobile.php file into the auth/email/db/ and mod/forum/db directories of your installation.
      3. Purge caches
      4. Execute the following curl request checking that in the response you see two array items under data->plugins (remotetest and anothertest) both with component field set to auth_email

        curl 'http://localhost/m/stable_master/lib/ajax/service.php' --data-binary '[\{"index":0,"methodname":"tool_mobile_get_plugins_supporting_mobile","args":\{}}]' | python -m "json.tool"

      1. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      2. Create a Token for the one user:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      3. Next, you can do a CURL REST call simulating a WS client with the student user.
        • You need to replace the wstoken, and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=tool_mobile_get_plugins_supporting_mobile&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' | python -m "json.tool"

      1. Confirm that now in plugins you see four array items: two of them with component set to auth_email and the other two to mod_forum
      Show
      As admin, enable the "Email self registration" auth method in your Moodle installation Then, place the attached mobile.php file into the auth/email/db/ and mod/forum/db directories of your installation. Purge caches Execute the following curl request checking that in the response you see two array items under data->plugins (remotetest and anothertest) both with component field set to auth_email curl 'http://localhost/m/stable_master/lib/ajax/service.php' --data-binary ' [\{"index":0,"methodname":"tool_mobile_get_plugins_supporting_mobile","args":\{}}] ' | python -m "json.tool" As admin, enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for the one user: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the student user. You need to replace the wstoken, and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=tool_mobile_get_plugins_supporting_mobile&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' | python -m "json.tool" Confirm that now in plugins you see four array items: two of them with component set to auth_email and the other two to mod_forum
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-58714-master

      Description

      We should be returning the list of remote add-ons for the auth plugin type in a public (not loggin required) Web Service.

      The reason is that now in the app we support add-ons for authentication, so we need to retrieve the list of remote add-ons before the user is logged-in (so he is able to create a user account in the site for example).

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/Nov/17