Custom Social Connection with Twitter / X

Overview

This article explains how to create a custom social connection with X, formerly Twitter, to control the permissions requested from Twitter as the default social connection with Twitter / X does not allow it.

Applies To

  • Social Connections

Cause

Using the default Twitter / X social connection does not allow changes in the requested permissions on the Twitter / X consent screen.

Solution

  1. Create a custom social connection by following Connect Apps to Generic OAuth2 Authorization Servers
  2. The Authorization URL should be set to: https://twitter.com/i/oauth2/authorize?&code_challenge=challenge&code_challenge_method=plain and the Token URL should be set to https://api.x.com/2/oauth2/token?code_verifier=challenge
  3. In the scopes value, add only the Twitter / X scopes that are required
    1. For example: users.read tweet.read offline.access