Creating a Twitter application
A web application can access a Twitter account only through a Twitter application. In this recipe, we will create a Twitter application. We will obtain an API key and an API secret, which are two strings that our web application will use to connect to Twitter in the following recipes.
Getting ready
Log in to your Twitter account.
How to do it…
- Go to https://apps.twitter.com/.
- Click on Create New App.
- Fill in the form and create your application. Note that
localhost
is not a valid domain name for the Callback URL field, but an IP address works. - On your application page, under Settings, check Allow this application to be used to Sign in with Twitter.
- Under Keys and Access Tokens, copy the API key and API secret values. You will use them in your web application to identify your Twitter application.