Authentication
To get started with accessing the Twitter API, you should first create a Twitter app. You create (or manage existing) apps at the Twitter Application Management page.
A Twitter app will have a consumer key and consumer secret that identifies your app and is used for security purposes when communicating with the Twitter API. Your app also has an access level that you can change depending on your needs. The access level defines whether your app will have write access or readonly access on behalf of the users that authenticate with your app.
Once you have created your app, there are two ways that you can access data in the Twitter API. Given that you just use the consumer key and consumer secret as described above, your app will communicate with the Twitter API using an app context.
To access the API on behalf of your users (user context), you can specify an access token and access token secret as well.
One last thing worth mentioning is that if you just need to access public data (eg. tweets of a user), an app context may be sufficient.