author | ms.service | ms.subservice | ms.topic | ms.date | ms.author |
---|---|---|---|---|---|
msmimart |
active-directory-b2c |
B2C |
include |
10/16/2019 |
mimart |
Web API resources need to be registered in your tenant before they can accept and respond to protected resource requests by client applications that present an access token.
To register an application in your Azure AD B2C tenant, you can use our new unified App registrations experience or our legacy Applications (Legacy) experience. Learn more about the new experience.
- Sign in to the Azure portal.
- Select the Directory + subscription filter in the top menu, and then select the directory that contains your Azure AD B2C tenant.
- In the left menu, select Azure AD B2C. Or, select All services and search for and select Azure AD B2C.
- Select App registrations, and then select New registration.
- Enter a Name for the application. For example, webapi1.
- Under Redirect URI, select Web, and then enter an endpoint where Azure AD B2C should return any tokens that your application requests. In this tutorial, the sample runs locally and listens at
http://localhost:5000
. - Select Register.
- Record the Application (client) ID for use in a later step.
Next, enable the implicit grant flow:
- Under Manage, select Authentication.
- Select Try out the new experience (if shown).
- Under Implicit grant, select both the Access tokens and ID tokens check boxes.
- Select Save.
- Sign in to the Azure portal.
- Select the Directory + subscription filter in the top menu, and then select the directory that contains your Azure AD B2C tenant.
- In the left menu, select Azure AD B2C. Or, select All services and search for and select Azure AD B2C.
- Select Applications (Legacy), and then select Add.
- Enter a name for the application. For example, webapi1.
- For Web App / Web API, select Yes.
- For Allow implicit flow, select Yes.
- For Reply URL, enter an endpoint where Azure AD B2C should return any tokens that your application requests. In this tutorial, the sample runs locally and listens at
https://localhost:5000
. - For App ID URI, add an API endpoint identifier to the URI shown. For this tutorial, enter
api
, so that the full URI is similar tohttps://contosob2c.onmicrosoft.com/api
. - Select Create.
- Record the APPLICATION ID for use in a later step.