Twitter APIs handle enormous amounts of data. The way we ensure this data is secured for developers and users alike is through authentication. There are a few methods for authentication, each listed below.


Most developers will not need to deal with the complexities surrounding authentication since client libraries automatically handle these difficulties.

You can find a list of available client libraries on our tools and libraries pages >

 

Authentication methods

OAuth 1.0a User Context

OAuth 1.0a allows an authorized Twitter developer App to access private account information or perform a Twitter action on behalf of a Twitter account.

OAuth 2.0 Bearer Token

OAuth 2.0 Bearer Token allows a Twitter developer app to access information publicly available on Twitter.

Basic authentication

Many of Twitter’s enterprise APIs require the use of HTTP Basic Authentication.

Please note

Your App's API Keys and Bearer Token, as well as your personal Access Token and Access Token Secret can be obtained from the Twitter developer Apps section found in the developer portal

If you would like to make requests on behalf of another user, you will need to generate a separate set of Access Tokens for that user using the 3-legged OAuth flow, and pass that user's tokens with your OAuth 1.0a User Context requests.

 

Additional resources

Guides

Learn how to generate tokens and authenticate requests using our integration guides.

API reference

Review our reference guides for our authentication endpoints.

Protect yourself

Make sure you understand the best practices for storing your keys and tokens.

Question?

Visit our FAQs.

Was this document helpful?
Thank you

Thank you for the feedback. We’re really glad we could help!

Thank you for the feedback. How could we improve this document?
Thank you for the feedback. Your comments will help us improve our documents in the future.