Implementing social login
For our first example, we'll use Twitter as our third-party authentication provider. If you want to follow along with the example you will need a Twitter account, which is very quick to set up.
Setting up a Twitter application
In order for Twitter to recognize our application, we need to create a new app in Twitter's developer portal:
- Visit https://apps.twitter.com/ and click on Create New App.
- Fill in the Name, Description, Website, and Callback URL fields:
- If you've deployed your application to Heroku, you can use its Heroku URL here
- Otherwise, just fill in placeholder values for both fields (for example,
http://test.example.com/callback
)
- Click on Create your Twitter application.
- Click on the Settings tab and ensure that Enable Callback Locking is unchecked (leaving this unchecked allows you to use placeholder values for the URLs and is also useful for local testing).
- Click on the Keys and Access Tokens tab to view your application's Consumer Key ...