Open https://dev.twitter.com/apps. Click on Create a new application.

Fill in name, description and website. For Callback URL use the following value:

Note: Twitter doesn't allow localhost as domain, use 127.0.0.1 instead!

Agree to the rules, fill in the captcha and click on Create your Twitter application

Now click on Settings and tick the box Allow this application to be used to Sign in with Twitter, and click on Update this Twitter application's settings.

Click on Details. Insert Consumer key and Consumer secret in the form below.

Close the help panel and click save changes.