OAuth2 operations are performed against the following OAuth2 endpoints requesting "r_basicprofile"and "r_emailaddress" privileges:
- Authorization: https://www.linkedin.com/uas/oauth2/authorization
- Token Retrieval: https://www.linkedin.com/uas/oauth2/accessToken
- User details acquisition: https://api.linkedin.com/v1/people/~:(id,first-name,last-name,email-address)?format=json
Setup
A client specific LinkedIn app must be created that allows access to the "r_basicprofile" and "r_emailaddress" privileges in order to access LinkedIn services and query user profile data.
Create the LinkedIn app from the "My Apps" section of https://developer.linkedin.com.
The new app will need "r_basicprofile" and "r_emailaddress" checking under "Default Application Permissions". The Authentication Worker's reentry method should be entered as an "Authorized Redirect URL" in the OAuth2.0 section eg https://mywebsite.com/apiserver/auth/http/reentry.
You will then have access to the "Client ID" and "Secret ID" needed below.
Parameters
As well as the parameters described in Base Provider Parameters, the following must be set in the params object.
Name | Types | Description |
---|---|---|
clientId | String, required | The Client ID from your LinkedIn App |
secret | String, required | The Secret ID from your LinkedIn App |
User Profile Data
Requested fields: id, firstName, lastName, emailAddress.
We request the following information from LinkedIn about a user. The properties are automatically mapped to the Authentication Worker's UserProfile class. These properties are then mapped to actual fields in a site user's profile, following the mappings set up in the
LinkedIn Property | Mapped To | Comments |
---|---|---|
id | UNIQUEID | LinkedIn's unique user identifier. |
n/a | TITLE | Not supplied by LinkedIn |
firstName | FORENAMES | |
firstName | PREFERREDNAME | |
lastName | SURNAME | |
emailAddress |
See the Linking Providers, Account and Profile Management article for information about how profiles and email addresses are updated.
Example
{
"providerName": "linkedin",
"providerDisplayName": "LinkedIn",
"type": "linkedin",
"userPrefix": "LI_",
"params": {
"clientId": "000000000000000",
"secret": "abcdef1234567890",
"checkConsentToStoreData": true,
"failIfConsentNotGiven": true
}
}