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

Support reCaptcha v2 in the mobile app

    XMLWordPrintable

Details

    • MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE
    • MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE
    • MDL-61600-master
    • 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.

    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)

      Attachments

        1. 3.3 - reCAPTCHA mobile.png
          3.3 - reCAPTCHA mobile.png
          21 kB
        2. 3.3 - reCAPTCHA web.png
          3.3 - reCAPTCHA web.png
          72 kB
        3. 3.4 - reCAPTCHA mobile.png
          3.4 - reCAPTCHA mobile.png
          21 kB
        4. 3.4 - reCAPTCHA web.png
          3.4 - reCAPTCHA web.png
          69 kB
        5. master - reCAPTCHA mobile.png
          master - reCAPTCHA mobile.png
          20 kB
        6. master - reCAPTCHA web.png
          master - reCAPTCHA web.png
          69 kB

        Issue Links

          Activity

            People

              dpalou Dani Palou
              jleyva Juan Leyva
              Carlos Escobedo Carlos Escobedo
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Mihail Geshoski Mihail Geshoski
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                19/Mar/18