Set up sign-up and sign-in with a Twitter account using Azure Active Directory B2C

Create an application

To use Twitter as an identity provider in Azure AD B2C, you need to create a Twitter application. If you don't already have a Twitter account, you can sign up at https://twitter.com/signup.

  1. Sign in to the Twitter Developers website with your Twitter account credentials.
  2. Select Create an app.
  3. Enter an App name and an Application description.
  4. In Website URL, enter https://your-tenant.b2clogin.com. Replace your-tenant with the name of your tenant. For example, https://contosob2c.b2clogin.com.
  5. For the Callback URL, enter https://your-tenant.b2clogin.com/your-tenant.onmicrosoft.com/your-user-flow-Id/oauth1/authresp. Replace your-tenant with the name of your tenant name and your-user-flow-Id with the identifier of your user flow. For example, b2c_1A_signup_signin_twitter. You need to use all lowercase letters when entering your tenant name and user flow id even if they are defined with uppercase letters in Azure AD B2C.
  6. At the bottom of the page, read and accept the terms, and then select Create.
  7. On the App details page, select Edit > Edit details, check the box for Enable Sign in with Twitter, and then select Save.
  8. Select Keys and tokens and record the Consumer API Key and the Consumer API secret key values to be used later.

Configure Twitter as an identity provider in your tenant

  1. Sign in to the Azure portal as the global administrator of your Azure AD B2C tenant.
  2. Make sure you're using the directory that contains your Azure AD B2C tenant by selecting the Directory + subscription filter in the top menu and choosing the directory that contains your tenant.
  3. Choose All services in the top-left corner of the Azure portal, search for and select Azure AD B2C.
  4. Select Identity providers, then select Twitter.
  5. Enter a Name. For example, Twitter.
  6. For the Client ID, enter the Consumer API Key of the Twitter application that you created earlier.
  7. For the Client secret, enter the Consumer API secret key that you recorded.
  8. Select Save.