Skip to content

OAuth providers

Twitter (X)

Set up Twitter (X) OAuth for reading and posting tweets

Connect your users to Twitter (X) for reading tweets, posting content, managing follows, and accessing user data.

PropertyValue
Provider IDtwitter
CategorySocial
PKCERequired
Token refreshAutomatic
Redirect URIShown in Developer Portal

Go to the Twitter Developer Portal

Navigate to developer.x.com/en/portal/dashboard and sign in.

Create a new project and app

Click Add App (or create a new Project first), enter the app name, and select the use case.

Configure OAuth 2.0

In app settings, under User authentication settings, enable OAuth 2.0. Set the Type of App to Web App. Add the Alter callback URL from the Developer Portal to the Callback URI field.

Get credentials

Copy the Client ID and Client Secret from the Keys and tokens tab.

Open the Developer Portal

Go to portal.alterauth.com and navigate to the application.

Add Twitter provider

Go to OAuth Providers > Add Provider > Twitter (X).

Enter credentials

  • Client ID: Paste your Twitter Client ID
  • Client Secret: Paste your Twitter Client Secret

Select scopes

Choose the scopes the application needs.

Save

Click Save. The provider is now active.

ScopeDescription
tweet.readRead tweets and timelines
tweet.writeCreate and delete tweets
users.readRead user profile data
follows.readRead follows and followers
follows.writeFollow and unfollow accounts
like.readRead liked tweets
like.writeLike and unlike tweets
offline.accessObtain a refresh token for long-lived access
space.readRead Twitter Spaces
bookmark.readRead bookmarks
bookmark.writeAdd and remove bookmarks
  • Twitter OAuth 2.0 requires PKCE. Alter Vault handles this automatically.
  • Always include offline.access to receive a refresh token.
  • See the Twitter OAuth 2.0 documentation for more details.