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