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

Auth: Add test settings for Oauth2

    XMLWordPrintable

Details

    • MOODLE_311_STABLE, MOODLE_400_STABLE
    • MOODLE_401_STABLE
    • master_MDL-73122
    • Hide
      1. Enable OAuth2 authentication plugin (Site administration > plugins > manage authentication)
      2. Set up an OAuth2 issuer
        1. Setting up OAuth2 can be tricky, it is recommended to review the documentation here: https://docs.moodle.org/311/en/OAuth_2_services
          You will need to have a functioning provider to test the full workflow.
        2. Setup a Microsoft provider, using the guide here: https://docs.moodle.org/311/en/OAuth_2_Microsoft_service (It doesn't have to be MS, but it is one of the easier ones to setup, and it allows "localhost")
        3. When setting up the OAuth2 provider unselect the "Require email validation" checkbox. (This makes testing steps easier)
      3. In the administration menu navigate to "Plugins > Manage authentication"
      4. Verify: That in the table row for "OAuth 2" There is now a "Test settings" link
      5. Click on the "Test settings" link
      6. The following page should display buttons with icons for the configured Oauth2 providers
      7. Click on the button that corresponds to the configured test provider
      8. You will now be redirected to the authentication workflow for the configured provider
      9. Log in with the test provider.
      10. Upon successful log with the test provider you should be redirected to the test results page
      11. A message confirm the test was successful should be displayed
      12. A table with the key value pairs of data returned from the oAuth2 provider should be displayed.
      Show
      Enable OAuth2 authentication plugin (Site administration > plugins > manage authentication) Set up an OAuth2 issuer Setting up OAuth2 can be tricky, it is recommended to review the documentation here: https://docs.moodle.org/311/en/OAuth_2_services You will need to have a functioning provider to test the full workflow. Setup a Microsoft provider, using the guide here: https://docs.moodle.org/311/en/OAuth_2_Microsoft_service (It doesn't have to be MS, but it is one of the easier ones to setup, and it allows "localhost") When setting up the OAuth2 provider unselect the "Require email validation" checkbox. (This makes testing steps easier) In the administration menu navigate to "Plugins > Manage authentication" Verify: That in the table row for "OAuth 2" There is now a "Test settings" link Click on the "Test settings" link The following page should display buttons with icons for the configured Oauth2 providers Click on the button that corresponds to the configured test provider You will now be redirected to the authentication workflow for the configured provider Log in with the test provider. Upon successful log with the test provider you should be redirected to the test results page A message confirm the test was successful should be displayed A table with the key value pairs of data returned from the oAuth2 provider should be displayed.

    Description

      You can configure your Oauth provider to send various pieces of user data at auth time into Moodle.  You can also map that data to user profile fields in Moodle.

      However, on the Oauth provider side there is often a difference between the "name" that is displayed in the provider UI for a particular field and the "encoded name" that is sent at auth time.  e.g "organisation name" as "org name". This makes it very hard to see what data is being sent so it can be mapped.

      Solve this by having a test page in the authentication page so administrators can see the data that is passed back on a successful auth.

      We do a very similar thing in the auth_saml2 plugin.

      Attachments

        1. MDL-73122.png
          MDL-73122.png
          37 kB
        2. 03_test results.png
          03_test results.png
          67 kB
        3. 02_test_auth.png
          02_test_auth.png
          48 kB
        4. 01_mange_auth.png
          01_mange_auth.png
          55 kB

        Issue Links

          Activity

            People

              marcalexandreghaly Marc-Alexandre GHALY
              mattp@catalyst-au.net Matt Porritt
              Tomo Tsuyuki Tomo Tsuyuki
              Victor Déniz Falcón Victor Déniz Falcón
              John Edward Pedregosa John Edward Pedregosa
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                28/Nov/22

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 6 hours, 1 minute
                  6h 1m