Note: You are currently viewing documentation for Moodle 4.0. Up-to-date documentation for the latest stable version of Moodle may be available here: OAuth 2 LinkedIn service.

OAuth 2 LinkedIn service: Difference between revisions

From MoodleDocs
No edit summary
(LinkedIn OAuth2 setup)
Line 1: Line 1:
{{OAuth2}}
{{OAuth2}}
'''Note: The following only applies to installs running Moodle 3.10 or later'''
== 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.


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).
On the 'Create an app' page, fill in the required fields:
* App name
* LinkedIn Page - The page that this app will be associated with
* App Logo
[[File:linkedin app creation.png]]


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.
After you're done creating the app, you will be redirected to a screen where you can manage various settings related to the app.


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.
=== Permissions / Scope requirements ===
[[es:Servicio OAuth 2 Linkedln]]
For the client to function properly, it needs to be granted permissions to retrieve information from a user. LinkedIn does this easily by defining 'Products' that an app can be associated with. Each product defines the various use case that the API can be used for. For Moodle purposes, we only require the 'Sign In with LinkedIn' product.
[[de:OAuth2 LinkedIn Service]]
 
Go to the Products tab and select the 'Sign In with LinkedIn' product
 
[[File:linkedin products prior selection.png]]
 
The product will be marked as 'Review in progress' and will take a few minutes to be approved. Once done, the product will be listed in the app's 'Added products' section.
 
[[File:linkedin added products.png]]
 
=== Client settings ===
Once the product have been successfully added, go to the 'Auth' tab. Here you will find the Authentication keys required to setup your issuer in Moodle. You will have to setup the authorised redirect URLs as is standard for OAuth2.
 
[[File:linkedin auth page.png]]
 
You will also find the OAuth2 scopes listed which was done as part of Scope requirements earlier.
 
[[File:linkedin scopes defined.png]]
 
== Issuer configuration ==
Authentication via LinkedIn is now a preconfigured service available for administrators. Go to 'Site Admin -> Server -> OAuth2 services' and click on the LinkedIn button.
All you need now is to enter and save the client id and secret and LinkedIn will now be an option for a user on the login page.
 
== See also ==
* [https://tracker.moodle.org/browse/MDL-65637 MDL-65637 - LinkedInAuthentication]

Revision as of 08:00, 5 July 2021

Note: The following only applies to installs running Moodle 3.10 or later

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.

On the 'Create an app' page, fill in the required fields:

  • App name
  • LinkedIn Page - The page that this app will be associated with
  • App Logo

linkedin app creation.png

After you're done creating the app, you will be redirected to a screen where you can manage various settings related to the app.

Permissions / Scope requirements

For the client to function properly, it needs to be granted permissions to retrieve information from a user. LinkedIn does this easily by defining 'Products' that an app can be associated with. Each product defines the various use case that the API can be used for. For Moodle purposes, we only require the 'Sign In with LinkedIn' product.

Go to the Products tab and select the 'Sign In with LinkedIn' product

linkedin products prior selection.png

The product will be marked as 'Review in progress' and will take a few minutes to be approved. Once done, the product will be listed in the app's 'Added products' section.

linkedin added products.png

Client settings

Once the product have been successfully added, go to the 'Auth' tab. Here you will find the Authentication keys required to setup your issuer in Moodle. You will have to setup the authorised redirect URLs as is standard for OAuth2.

linkedin auth page.png

You will also find the OAuth2 scopes listed which was done as part of Scope requirements earlier.

linkedin scopes defined.png

Issuer configuration

Authentication via LinkedIn is now a preconfigured service available for administrators. Go to 'Site Admin -> Server -> OAuth2 services' and click on the LinkedIn button. All you need now is to enter and save the client id and secret and LinkedIn will now be an option for a user on the login page.

See also