OAuth 2 Authentication: Show LinkedIn Profile Info

Intermediate

17 Dec 2015   Integration

This entire manual refers to a feature that was added in version 4.16.1

To understand OAuth 2.0 authentication, consider the following example of LinkedIn authentication integrated within Squiz Matrix to retrieve the profile data of our LinkedIn account.

  1. First, create a new testing application on your LinkedIn account at the LinkedIn Developer Network. You will receive the application ID and secret.

    Make sure the URL of your site is defined when configuring the LinkedIn application.

  2. Create an OAuth2 Token asset.
  3. On the Details screen, enter the ID and Secret provided to you by LinkedIn in the Client ID and Client Secret fields.
  4. In the Authorisation Endpoint field, enter https://www.linkedin.com/uas/oauth2/authorization.
  5. In the Token Endpoint field, enter https://www.linkedin.com/uas/oauth2/accessToken.
  6. In the Access Token URI Parameter Name field, enter oauth2_access_token.
  7. Create a REST Resource asset.
  8. On the Details screen, set the request URL as https://api.linkedin.com/v1/people/~:(id,first-name,last-name,industry)?format=json.
  9. Set the Authentication Type as OAuth and select the OAuth2 Token asset that was created earlier.

    Setting the Authentication Type
    Configuring the Authentication Type field on the REST Resource asset

  10. Preview the REST Resource asset in the front end; you will be redirected to LinkedIn for authentication. Upon successful authentication, the access token will be displayed on the Details screen of the OAuth2 Token asset.

    LinkedIn Authentication
    Authenticating the LinkedIn Account

After successful authentication, your profile data (first name, last name and industry) will be printed on this asset in JSON format. This information can then be further customised, for example, using either the JS or JSON Data Source assets.