Twitter authentication setup

From CommunityData
Jump to navigation Jump to search

Things you will need before you start:

  • A Twitter account. If your Twitter profile doesn't have your current mobile number associated with it, you will need to add your mobile number in order to create your new app as part of the process.

Follow each of these steps:

1. Go to the Twitter development homepage:

2. If you're not already signed in to Twitter, click on Sign In in the top right corner of the page. You can sign in with your normal Twitter account. (It may take you to your Twitter home page when you sign in. If so, return to once you're logged on.)

3. Click on the "Manage Your Apps" link ( The link should be located at the bottom of the page under the heading, "Tools." This will take you to a page that says "You don't currently have any Twitter Apps" with a button underneath that says "Create New App". Click the "Create New App" button.

4. The next page will ask for application details. The first three are required so you will need to create a Name, Description, and Website URL. You can choose whatever you want for these fields but keep in mind that the name can not contain the word "Twitter". Also keep in mind that the name needs to be unique in the world. The name itself does not matter. You should leave the "Callback URL" blank. You will also need to click the checkbox to agree to the Twitter Developer Agreement.

Name: CDSW Test Application for <YOUR NAME>
Description: CDSW Test Application

Below this, you will see a long "Developer Agreement". Look through this and, if you agree, click the checkbox marked "Yes, I agree." (If you haven't included your mobile number in your profile information, you may be asked to do this before you can continue with creating an app).

6. You should now see page a page that says "Application Management" on the top and the name of your app (probably "CDSW Test Application for <YOUR NAME>") right below the blue bar.

Right below that there are four tabs that say::

Keys and Access Tokens

7. Click on the Keys and Access Tokens tab.

You should now see a list of "Application settings". The first two here are the most important and you will need to copy and paste these into a file. The first is the Consumer Key (API key). The second is the Consumer Secret (API secret). Both of them should be long strings of garbage looking letters and numbers. These are the keys that will let your program know that it's approved to grab data from Twitter.

8. Now, at the bottom of the page you should see a section marked "Your Access Token" that says, "You haven't authorized this application for your own account yet." Below that there is a button that says "Create my access token". Click on that button. Once you press it there will be a yellow 'Status' box at the top. It will give you a link you can click to refresh. Wait a minute or two and click it until you see information, below including lines that give you your "Access token" and your "Access token secret". Copy these two pieces of information.

9. You should have four long strings of letters and numbers taken from this page now:

  • Consumer Key (API key)
  • Consumer Secret (API secret)
  • Access token
  • Access token secret

You will need all of these in order to have your Twitter application work.

Copy and paste each of these into a document or text file so that you have them all and know which ones are which. Bring this information to the Saturday session.

Keep this material secret. Your access token and access token secret will allow anybody who has it to post to Twitter as you and to control your account. It is equivalent to your Twitter username and password so please be as careful with it as you would be with your Twitter password!

Other documentation[edit]