Accessing Twitter In Azure Active Directory B2C

Introduction

In this article, I will explain about using Twitter sign-up and sign-in with Azure. For using Twitter in Azure Active Directory B2C, we need to create a Twitter application and configure the parameters. For this, we need a Twitter Developer account to log into https://dev.twitter.com/

Prerequisites
  • An active Azure subscription.
  • Twitter account.

Creating a Twitter application

Step 1

Open Twitter Developers website https://dev.twitter.com.

Step 2

Click My apps-> sign-in with username and password. 



Click "Create New App".
 
 
Step 3

Now, we need to configure some of the requirements as given below.

Provide a name, a short description, the website and callback URL. 

Step 4

Select the checkbox to agree the agreement and click "Create your Twitter application".

Step 5

The app will be created. Click "Keys and Access Tokens" tab and note down the consumer key and consumer secret key to be used later.

Create Azure Active Directory

Step 6

Now, switch back to the Azure portal and click "New". Search for Azure Active Directory B2C and click Azure AD B2C, as shown below.


Step 7

Click "Create" for configuring the Active Directory B2C.

Step 8

Click "Create a new Azure AD B2C Tenant".

Step 9

Provide a name and domain name with region, and click "Create".

Step 10

The sucess notification will be displayed after a few minutes. Click "Link an existing Azure AD B2C Tenant to my Azure subscription" and select "Azure AD".

Proceed with B2C Tenant and select Resource group with resource location. Then, click "Create".

Registering Web API

Step 11

In B2C blade, click "Applications".

Step 12

Click "Add" on top side of the next blade.

Step 13

We need to provide a unique name for the application. Select "Include Web app/API" and toggle to "Yes" to enable the app ID URL that acts as an identifier for Web API. Finally, click "Create".

Configuring Twitter in Tenant of Azure

Step 14

On B2C blade, click "Identity providers", and click "Add".

Step 15

Provide a name for the configuration, as per your desire.

Step 16

Select the Identity provider type and select "username" followed by a click on OK. Now, select the identity provider. Proceed with the provider type, enter the consumer key and the consumer secret keys.

Step 17

The consumer key is for the client id and consumer secret key is for the client secret. Click OK.

Click "Create" for configuration of Twitter account.

 
That's it. For any queries or suggestions, do comment. 

Up Next
    Ebook Download
    View all
    Learn
    View all