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

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

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.4, 3.5, 3.7
    • Fix Version/s: 3.7
    • Component/s: Authentication
    • Labels:
    • Testing Instructions:
      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
    • Affected Branches:
      MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_37_STABLE
    • Pull Master Branch:
      MDL-61767-master

      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

              Assignee:
              mastnym Martin Mastny
              Reporter:
              mastnym Martin Mastny
              Peer reviewer:
              Andrew Nicols
              Integrator:
              Jun Pataleta
              Tester:
              Janelle Barcega
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              5 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                20/May/19

                  Time Tracking

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