Simple Guide to Add Twitter Authorization on Your Website (Part 2)

Twitter application set-up

Today I will continue my article Sign in with Twitter and will tell how to set up Twitter application and how to get Consumer key and Consumer secret in Twitter.

I guess you already know what Twitter is and its purpose. If not, detailed information about Twitter you can find here

First of all, you have to log in with your Twitter account or register, if you don’t have one.

Then you have to perform following steps in order to get Twitter keys:

1) Visit the website for Twitter developers - (not traditional as usually)
2) Authorize in this resource
3) Choose “My applications” in the upper right corner

This page will show all the applications you use in Twitter. By default it should be empty, if you have never visited it before. Here we will create application containing access keys, that we will use later in PHP code on your website.

4) Click the button “Create a new application”

The window should open with the information needed to be filled in, such as:

  • Name – application name. It can be the name of your website
  • Description – short description of your application 
  • Website – website from which authorization will be held (make sure you set the right name as shown on the example. If the queries are sent from another domain, authorization will be impossible)
  • Callback URL – redirection webpage after authorization 

Agree to the terms and conditions, type CAPTCHA and click “Create your Twitter application”.

After successful registration you will be automatically redirected to “Details” page

This page contains all the data about the application. As a matter of fact, you do not have to enter any additional information. If you take a look at the Access level field you will see that reading mode is set by default and it will be enough for us to perform users’ authorization.

It’s important to save data in Consumer key and Consumer secret fields as they will be used in the process of user authorization through your website.

So, application set up is performed successfully. In our next article I will tell how to write PHP code for user authorization as described in Sign in with Twitter.

See also: How to Get a Suitable Container List of Your Tweets