Configuring Passport's LinkedIn strategy
The configuration for all the strategies is somewhat similar. So, the following are the steps we have to follow to configure this strategy:
- Creating and registering an application on LinkedIn. This will provide us with a consumer key (API Key) and a consumer secret (API Secret).
- Adding a button to our login page that allows users to log in via LinkedIn.
- Adding the necessary routes.
- Adding a middleware method to check authentication.
- Redirecting the user to the home page and displaying the logged in user's email in the top bar.
Let's dive into the details for each of the preceding steps.
Creating and setting up a LinkedIn app
Just like we did for the Facebook and Twitter Strategies, to be able to use the Linkedin Strategy, we have to build a LinkedIn application. The developers, portal for LinkedIn is at https://www.linkedin.com/developer/apps. You will see a list of all of your applications there. You will also note a button to create a new application...