O'Reilly logo

Mastering JavaScript Single Page Application Development by John Moore, Philip Klauzinski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Connecting to Twitter

One of the great things about Passport, and OAuth 2, is that there are a ton of different strategies we can use to authenticate with third parties. Let's set up Twitter authentication.

Adding a Twitter app

Similar to Facebook, we need to set up an app on Twitter for our application to communicate with. Head on over to https://apps.twitter.com and create a new app:

Adding a Twitter app

Fill in a name, description, and the two URLs. At the time of writing, Twitter does not allow http://localhost as a URL, so you have to use http://127.0.0.1.

Now click over to Keys and Access Tokens and grab your Consumer Key and Consumer Secret. We're going to add ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required