Skip to content
Last updated

Twitter integration

Integrating Twitter with Frontegg allows your application to read tweets, post on behalf of users, and access direct messages — all through Frontegg's integration layer using X's OAuth 2.0.


Prerequisites

Create a Twitter OAuth app

Step 1: Open the X Developer Console

Go to console.x.com and sign in with your X (Twitter) account. After signing in, you land on the developer dashboard.

X Developer Console dashboard

Step 2: Open the Apps page

In the left sidebar, click Apps. On the Apps page, click Create App.

Apps page with Create App button highlighted

Step 3: Name your app

In the Create New Client Application dialog:

  1. Enter a name for the app — for example, Frontegg Integration.
  2. Leave Environment as Development.
  3. Click Create New Client Application.

Create New Client Application dialog with name filled in

Step 4: Save or close the initial credentials dialog

After the app is created, a dialog displays a Consumer Key, Secret Key, and Bearer Token. These are OAuth 1.0a credentials — save them if you intend to use OAuth 1.0a access. For the Frontegg integration, you will use OAuth 2.0 credentials that are generated in a later step.

Click Close to dismiss the dialog.

Save your credentials

The Secret Key and Bearer Token are shown only once. If you need OAuth 1.0a access, copy and save them before closing this dialog.

Application Created Successfully dialog showing Consumer Key and blurred secrets

Step 5: Set up user authentication

After closing the dialog, click on Frontegg Integration in the app list on the left. The app panel opens on the right. Under User authentication settings, click Set up.

App panel showing User authentication settings section with Set up button highlighted

Step 6: Configure permissions and app type

On the Authentication settings page:

  1. Under App permissions, select Read and write and Direct message.
  2. Under Type of App, select Web App, Automated App or Bot (Confidential client).

Authentication settings page showing permissions and app type selections

Step 7: Add redirect URIs and save

Under App info, configure the following fields:

  1. In the Callback URI / Redirect URL field, enter:
    https://YOUR_MCP_GATEWAY_URL/integration-callback
  2. Click Add another and enter:
  3. In the Website URL field, enter your application's URL.
  4. Click Save Changes.

App info section with the redirect URI filled in and Save Changes button

Step 8: Copy your OAuth 2.0 credentials

After saving, a dialog displays your OAuth 2.0 Client ID and Client Secret. Copy both values and store them securely.

Save your Client Secret now

The Client Secret is shown only once in this dialog. After you close it, you can only regenerate a new one — the original value cannot be retrieved.

Did you save your OAuth 2.0 Client Secret dialog showing Client ID and blurred Client Secret

You can view the Client ID at any time by clicking on the app name in the Apps list and scrolling to the OAuth 2.0 Keys section.

App panel showing OAuth 2.0 Keys section with Client ID visible

Configure the Frontegg portal

Once you have your Client ID and Client Secret, enter them in the Frontegg portal:

  1. Open the Frontegg portal and navigate to [ENVIRONMENT] → Integrations → Twitter.
  2. Enter the Client ID and Client Secret in the corresponding fields.
  3. Select the required scopes:
ScopeDescription
tweet.readRead tweets
tweet.writePost tweets
users.readRead user data
offline.accessStay connected to account
dm.readRead direct messages
dm.writeSend direct messages
  1. Click Save.

Keep your credentials secure

Never share or commit your Client Secret to version control.

Additional resources