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

Update user profile fields according to info send by OAuth2 authorization server

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.4, 3.5, 3.7
    • 3.7
    • Authentication
    • MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_37_STABLE
    • MOODLE_37_STABLE
    • MDL-61767-master
    • Hide
      1. Setup a Google OAuth2 service
        1. Untick the "Require email verification"
      2. Connect the system account
      3. Go to Site administration / Plugins / Authentication / Manage authentication.
      4. Enable the oAuth2 authentication mechanism
      5. Navigate to Site administration -> Users -> Browse
      6. Edit an existing user
      7. Set your Gmail account's e-mail address as the user's e-mail address
      8. Log out
      9. Log in again, with the account using oAuth2
        1. Confirm that the user's name and picture now reflect those on your account
      10. Log out
      11. Log in via oAuth2 again using a different Gmail account
        1. Confirm that the account was created
        2. Confirm that the details of that account were also pulled in
      Show
      Setup a Google OAuth2 service Untick the "Require email verification" Connect the system account Go to Site administration / Plugins / Authentication / Manage authentication. Enable the oAuth2 authentication mechanism Navigate to Site administration -> Users -> Browse Edit an existing user Set your Gmail account's e-mail address as the user's e-mail address Log out Log in again, with the account using oAuth2 Confirm that the user's name and picture now reflect those on your account Log out Log in via oAuth2 again using a different Gmail account Confirm that the account was created Confirm that the details of that account were also pulled in

    Description

      When a user is created using OAuth2 authentication profile fields are filled with his/her details (firstname, lastname, whatever else is sent from auth server..).

      But when the user logs again and his/her details changed in the meantime, these details are not propagated into his/her profile.

      There is a piece of code in auth/oauth2/classes/auth.php with:

      /**
           * Indicates if moodle should automatically update internal user
           * records with data from external sources using the information
           * from auth_plugin_base::get_userinfo().
           *
           * @return bool true means automatically copy data from ext to user table
           */
          public function is_synchronised_with_external() {
              return false;
          }
      

      which seems to be like a good place to start.
      Am I missing something or is this functionality already pressent, but hidden somewhere?

      There is also MDL-58090 which says in description:

      5. Implement a new auth plugin that displayes the installed OAuth services in a list on the login page and will login and update the user details via OAuth.

      Attachments

        Issue Links

          Activity

            People

              mastnym Martin Mastny
              mastnym Martin Mastny
              Andrew Lyons Andrew Lyons
              Jun Pataleta Jun Pataleta
              Janelle Barcega Janelle Barcega
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              5 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                20/May/19

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 50 minutes
                  50m