OAuth 2 LinkedIn service: Difference between revisions

From MoodleDocs
No edit summary
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{OAuth2}}
{{OAuth2}}


From 1 May 2019, LinkedIn no longer support their v1 API, which could previously be configured as an OAuth 2 authentication method in Moodle. According to LinkedIn's v2 API [https://docs.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/migration-faq?context=linkedin/consumer/context migration documentation], the new API replaces the old basic user information endpoint with a 'lite' endpoint, which does not include a user's email address (which must be retrieved from a separate endpoint).
== LinkedIn setup ==
To setup an OAuth 2 client with LinkedIn, first we need to login to the [https://www.linkedin.com/developers/ LinkedIn Developers page] and create a new app.


Since email address is a required field in Moodle, and our OAuth 2 implementation currently requires all user information to be retrieved from a single endpoint, the LinkedIn v2 API currently appears to be incompatible with Moodle's "Custom OAuth 2 Service" feature.
*Request access and  add the product "Sign in with LinkedIn using OpenID Connect".
*Make sure you've set the "Authorized redirect URLs for your app" to: YOURSITE/admin/oauth2callback.php
*Go to your Moodle site and log in as admin.
*Go to "Site admin > Plugins > Authentication" and enable the "OAuth2" authentication plugin
*Go to "Site admin > Server > OAuth 2 Services"
*Click the "LinkedIn" button
*Enter your Client ID and Client secret (You'll find these on the 'Auth' tab of your LinkedIn dev portal app.)
*Decide whether or not to uncheck "Require email verification" -and if you do uncheck it, tick the "I understand that disabling email verification can be a security issue" box to confirm.
*Save changes.


We are continuing to investigate a workaround for the new API, and will update this documentation further when a solution can be found. In the meantime, if you have any information that may assist with this, please contribute to Tracker issue MDL-65637.
[[File:ouath2linkedin.png]]
[[es:Servicio OAuth 2 Linkedln]]
 
[[de:OAuth2 LinkedIn Service]]
 
Users will now see a LinkedIn option when logging in to your site.
 
[[File:LinkedInlogin.png|left|500px]]

Latest revision as of 15:27, 3 December 2023


LinkedIn setup

To setup an OAuth 2 client with LinkedIn, first we need to login to the LinkedIn Developers page and create a new app.

  • Request access and add the product "Sign in with LinkedIn using OpenID Connect".
  • Make sure you've set the "Authorized redirect URLs for your app" to: YOURSITE/admin/oauth2callback.php
  • Go to your Moodle site and log in as admin.
  • Go to "Site admin > Plugins > Authentication" and enable the "OAuth2" authentication plugin
  • Go to "Site admin > Server > OAuth 2 Services"
  • Click the "LinkedIn" button
  • Enter your Client ID and Client secret (You'll find these on the 'Auth' tab of your LinkedIn dev portal app.)
  • Decide whether or not to uncheck "Require email verification" -and if you do uncheck it, tick the "I understand that disabling email verification can be a security issue" box to confirm.
  • Save changes.

ouath2linkedin.png


Users will now see a LinkedIn option when logging in to your site.

LinkedInlogin.png