Connect your Client to Twitter

To connect your Auth0 client to Twitter, you will need to generate Consumer and Secret Keys in a Twitter application, copy these into your Auth0 settings, and enable the connection.

Create a Twitter application

  1. Login to Twitter Application Management.

  2. Click Create New App:

  3. Provide the required information. For Callback URL, enter https://YOUR_AUTH0_DOMAIN/login/callback

  4. Agree to the Developer Agreement and click Create your Twitter Application.

  5. Once the app is created, go to the Settings tab and verify that the Allow this application to be used to Sign in with Twitter option is selected.

Get your Consumer Key and Consumer Secret

  1. Your Consumer Key and Consumer Secret will be displayed in the Keys and Access Tokens tab of your app on Twitter:

  2. Leave this window open.

Copy your Consumer Key and Consumer Secret into Auth0

  1. In a separate window, login to the Auth0 Dashboard and select Connections > Social in the left navigation.

  2. Select the connection with the Twitter logo to access this connection's Settings page.

  3. Copy the Consumer Key and Consumer Secret from your app's Keys and Access Tokens tab on Twitter into the fields on this page on Auth0.

  4. Click Save.

Twitter Profile Attribute Permissions

Unlike many social identity providers, Twitter manages profile attribute permissions at the application level. By default, your client will be granted Read and Write permissions. You can customize these in the Permissions section of the Twitter Application Management page. For more information, see: Application Permission Model.

Enable the Connection

  1. Go to the Clients tab of the Twitter connection on Auth0 and select each of your existing Auth0 clients for which you want to enable this connection:

  2. Click Save.

Test your connection

  1. Go back to the Connections > Social section of the Auth0 dashboard. If you have configured your app correctly, you will see a Try icon next to the Twitter logo:

  2. Click the Twitter logo to return to the Settings page of this connection and click Try:

  3. You will be asked to sign-in to Twitter to authorize your new app to access your Twitter account:

  4. If you have configured everything correctly, you will see the It works!!! page:

Get an Access Token from Twitter (Optional)

Twitter allows application owners to generate OAuth access tokens that can be used to call the Twitter API on their own behalf.

To generate an Access Token and Secret:

  1. Go to the Application Management page on Twitter and select your application.

  2. Click Keys and Access Tokens.

  3. Click Create my access token near the bottom of the page to generate an authorized Access Token and Secret. Do not share your Access Token Secret.

NOTE: You can also regenerate or revoke your Access Token and Secret in case they have been compromised.