Authentication methods
OAuth 1.0a User Context
OAuth 1.0a allows an authorized X developer App to access private account information or perform a X action on behalf of a X account.
Learn More
Learn More
App only
App only Access Token allows a X developer app to access information publicly available on X.
Learn More
Learn More
Basic authentication
OAuth 2.0 Authorization Code Flow with PKCE
OAuth 2.0 User Context allows you to authenticate on behalf of another account with greater control over an application’s scope, and authorization flows across multiple devices.
Learn More
Learn More
Note:
You can get your App’s API Keys, App-only Access Token, personal Access Token, and Access Token Secret from the X developer Apps section in the Developer Console.To make requests on behalf of another user, generate a separate set of Access Tokens for that user using the 3-legged OAuth flow, then pass that user’s tokens with your OAuth 1.0a User Context or OAuth 2.0 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.
Best practices
Make sure you protect yourself and understand the best practices for storing your keys and tokens.
FAQs
Have a question? Visit our FAQs.