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

Linkedin Authentication Stopped working

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Prerequisites:

      1. Publicly accessible Moodle site with admin access - using ngrok or similar
      2. Setup outgoing email in your moodle instance. (you can use tools for testing outgoing emails such as Mailcatcher or MailHog).
      3. LinkedIn developer account - DevAccount
      4. LinkedIn regular account - NormalAccount

      Setup:

      1. Login to the developer account - https://www.linkedin.com/developers/
      2. Create an app and fill in
        1. An app name
        2. Choose a linkedin page. - for test purposes choose LinkedIn
        3. Upload a logo
      3. Click the 'Create an app' button
      4. Once redirected to the App page, go to the Auth tab.
      5. Note down the clientID and secret (to be used later)
      6. Fill in the 'Authorised redirect URLs for your app' to 'https:// {your moodle site}/admin/oauth2callback.php'
      1. Go to the 'Products' tab
      2. Select the 'Sign in with LinkedIn' product - this will provide your application with the necessary scopes. Note - It will take a few minutes to get approved.

      Testing:

      1. Login to your moodle site as admin
      2. Go to Site Admin -> Plugins -> Authentication -> Manage authentication
      3. Enable OAuth2.
      4. Go to Site Admin -> Server -> OAuth2 Services
      5. Confirm you see a 'LinkedIn' button in the 'Create a new service'
      6. Click the button
      7. Confirm you are redirected to the 'Create a new service' page
      8. Confirm the following are prefilled:
        1. The docs link redirects to LinkedIn OAuth page
        2. Name - LinkedIn
        3. Service base URL - https://api.linkedin.com/v2
        4. Scopes in a login request - r_liteprofile r_emailaddress
        5. Scopes included in a login request for offline access - r_liteprofile r_emailaddress
      9. Enter the ClientID and ClientSecret
      10. Save changes
      11. Confirm you can now see the newly created 'LinkedIn' service.
      12. Logout
      13. Go to the login page
      14. Confirm you can see 'LinkedIn' as an option to login to the site
      15. Click the 'LinkedIn' option.
      16. Follow the prompts to sign in to LinkedIn using the 'NormalAccount'
      17. Confirm you are redirected back to your moodle site after this process
      18. Confirm you see a message that an email has been sent to you for confirmation
      19. Confirm receipt of this message
      20. Verify receipt of the message by clicking the link within the email.
      21. Once verified, confirm you can now access the moodle site using the linkedin credentials
      22. Log out
      23. Log back in using 'LinkedIn' with the NormalAccount.
      24. Go to your profile and confirm the following fields match up to your linkedin profile:
        1. First name
        2. Last name
        3. Email
        4. Profile picture
      Show
      Prerequisites: Publicly accessible Moodle site with admin access - using ngrok or similar Setup outgoing email in your moodle instance. (you can use tools for testing outgoing emails such as Mailcatcher or MailHog). LinkedIn developer account - DevAccount LinkedIn regular account - NormalAccount Setup: Login to the developer account - https://www.linkedin.com/developers/ Create an app and fill in An app name Choose a linkedin page. - for test purposes choose LinkedIn Upload a logo Click the 'Create an app' button Once redirected to the App page, go to the Auth tab. Note down the clientID and secret (to be used later) Fill in the 'Authorised redirect URLs for your app' to 'https:// {your moodle site}/admin/oauth2callback.php' Go to the 'Products' tab Select the 'Sign in with LinkedIn' product - this will provide your application with the necessary scopes. Note - It will take a few minutes to get approved. Testing: Login to your moodle site as admin Go to Site Admin -> Plugins -> Authentication -> Manage authentication Enable OAuth2. Go to Site Admin -> Server -> OAuth2 Services Confirm you see a 'LinkedIn' button in the 'Create a new service' Click the button Confirm you are redirected to the 'Create a new service' page Confirm the following are prefilled: The docs link redirects to LinkedIn OAuth page Name - LinkedIn Service base URL - https://api.linkedin.com/v2 Scopes in a login request - r_liteprofile r_emailaddress Scopes included in a login request for offline access - r_liteprofile r_emailaddress Enter the ClientID and ClientSecret Save changes Confirm you can now see the newly created 'LinkedIn' service. Logout Go to the login page Confirm you can see 'LinkedIn' as an option to login to the site Click the 'LinkedIn' option. Follow the prompts to sign in to LinkedIn using the 'NormalAccount' Confirm you are redirected back to your moodle site after this process Confirm you see a message that an email has been sent to you for confirmation Confirm receipt of this message Verify receipt of the message by clicking the link within the email. Once verified, confirm you can now access the moodle site using the linkedin credentials Log out Log back in using 'LinkedIn' with the NormalAccount. Go to your profile and confirm the following fields match up to your linkedin profile: First name Last name Email Profile picture
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_310_STABLE, MOODLE_311_STABLE
    • Pull from Repository:
    • Pull 3.10 Branch:
      MDL-65637-310
    • Pull 3.11 Branch:
      MDL-65637-311
    • Pull Master Branch:
      MDL-65637-master
    • Story Points:
      3
    • Sprint:
      Navigation push ahead

      Description

      Linkedin migrated to API V2

      Now linkedin authentication gives the error: No user information was returned. The OAuth 2 service may be configured incorrectly.

      The documentation on https://docs.moodle.org/35/en/OAuth_2_LinkedIn_service seems to be outdated and not matching

        Attachments

          Activity

            People

            Assignee:
            peterdias Peter Dias
            Reporter:
            bertvanderhooft Bert van der Hooft
            Peer reviewer:
            Mihail Geshoski Mihail Geshoski
            Integrator:
            Andrew Lyons Andrew Lyons
            Tester:
            Mathew May Mathew May
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            10 Vote for this issue
            Watchers:
            25 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              12/Jul/21

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days, 7 hours
                2d 7h