Configuring Passport's Twitter Strategy
Just like Facebook Strategy, we have to perform the following steps to configure passport's Twitter Strategy:
- Creating and setting up a Twitter application. 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 our users to
LOGIN WITH TWITTER
. - Adding the necessary routes.
- Adding a middleware method to check authentication.
- Redirecting the user to the home page after redirection 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 Twitter app
Just as with Facebook Strategy, to be able to use the Twitter Strategy, we have to build a Twitter application as well. The developers' portal for Twitter is at https://apps.twitter.com/, where you will see a list of all of your applications. If this is new, you will see a button to create a new application—click on Create your Twitter application
.
You...