Skip to main content

Register a web application

  1. Make sure you are using the directory that contains your Azure AD B2C tenant.
  2. In the Azure portal, search for and select Azure AD B2C.
  3. Select App registrations, and then select New registration.
  4. Enter a Name for the application. For example, webapp1.
  5. Under Supported account types, select Accounts in any identity provider or organizational directory (for authenticating users with user flows).
  6. Under Redirect URI, select Web, and then enter in the URL textbox.
  7. Under Permissions, select the Grant admin consent to openid and offline_access permissions checkbox.
  8. Select Register.

For a web application, you need to create an application secret. The client secret is also known as an application password. The secret is used by your application to exchange an authorization code for an access token.

  1. On the Azure AD B2C - App registrations page, select the application you created, in our example, webapp1.
  2. In the left menu, under Manage, select Certificates & secrets.
  3. Select New client secret.
  4. Enter a description for the client secret in the Description box. For example, clientsecret1.
  5. Under Expires, select a duration for which the secret is valid, and then select Add.
  6. Record the secret Value for use in your client application code. This secret value is never displayed again after you leave this page. You use this value as the application secret in your application code.

Connect the webapp1 app with the app for testing a user flow or custom policy by enabling the implicit grant flow in the app registration:

  1. In the left menu, under Manage, select Authentication.
  2. Under Implicit grant and hybrid flows, select both the Access tokens (used for implicit flows) and D tokens (used for implicit and hybrid flows) checkboxes.
  3. Select Save.

For more information, see Tutorial: Register a web application in Azure Active Directory B2C in the Microsoft Azure documentation.