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

Support reCaptcha v2 in the mobile app

    Details

    • Testing Instructions:
      Hide

      If you use a local site, you can use ngrok or serveo.net to expose your local machine to connect the app to. Otherwise, you can just configure the Moodle site to use your machine IP and use that IP to connect the app (you'll have to add the IP in the reCaptcha domain list).

      1. As admin, set up site reCAPTCHA keys (Site administration > Plugins > Authentication > Manage authentication).
      2. Go to Site administration > Security > HTTP security and enable "Allow frame embedding".
      3. Enable "Mobile services": Plugins ► Web Services ► Mobile
      4. In a course, create a page resource including this HTML content (you need to replace http://192.168.1.37/m/stable_master/ with your site URL):

        <iframe title="abc" src="http://192.168.1.37/m/stable_master/webservice/recaptcha.php" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" frameborder="0" style="width: 100%; height: 500px;"></iframe>

      5. Open the page and check that you can see and answer the recaptcha.
      6. Log-in with a student enrolled in that course in the Mobile app, open the page and check that you can see and answer the recaptcha.
      Show
      If you use a local site, you can use ngrok or serveo.net to expose your local machine to connect the app to. Otherwise, you can just configure the Moodle site to use your machine IP and use that IP to connect the app (you'll have to add the IP in the reCaptcha domain list). As admin, set up site reCAPTCHA keys (Site administration > Plugins > Authentication > Manage authentication). Go to Site administration > Security > HTTP security and enable "Allow frame embedding". Enable "Mobile services": Plugins ► Web Services ► Mobile In a course, create a page resource including this HTML content (you need to replace http://192.168.1.37/m/stable_master/ with your site URL): <iframe title="abc" src="http://192.168.1.37/m/stable_master/webservice/recaptcha.php" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" frameborder="0" style="width: 100%; height: 500px;"></iframe> Open the page and check that you can see and answer the recaptcha. Log-in with a student enrolled in that course in the Mobile app, open the page and check that you can see and answer the recaptcha.
    • Affected Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE
    • Pull from Repository:
    • Pull 3.3 Branch:
    • Pull 3.4 Branch:
    • Pull Master Branch:
      MDL-61600-master

      Description

      Due to the IP (remote host) reCaptcha v2 restrictions, the app will need to display the recaptcha challenge in an iframe pointing to a PHP script on the site.

      We need to develop that script and place it somewhere like webservice/recaptcha.php. The script will generate the recaptcha javascript code (including empty callback functions to be overriden by the parent window)

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    19/Mar/18