You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/api-management/api-management-howto-aad-b2c.md
+28-3Lines changed: 28 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ author: dlepow
7
7
8
8
ms.service: api-management
9
9
ms.topic: how-to
10
-
ms.date: 09/28/2021
10
+
ms.date: 07/12/2022
11
11
ms.author: danlep
12
12
---
13
13
@@ -18,6 +18,10 @@ Azure Active Directory B2C is a cloud identity management solution for consumer-
18
18
19
19
In this tutorial, you'll learn the configuration required in your API Management service to integrate with Azure Active Directory B2C. As noted later in this article, if you are using the deprecated legacy developer portal, some steps will differ.
20
20
21
+
> [!IMPORTANT]
22
+
> * This article has been updated with steps to configure an Azure AD B2C app using the Microsoft Authentication Library ([MSAL](../active-directory/develop/msal-overview.md)) v2.0.
23
+
> * If you previously configured an Azure AD B2C app for user sign-in using the Azure AD Authentication Library (ADAL), we recommend that you [migrate to MSAL](#migrate-to-msal).
24
+
21
25
For information about enabling access to the developer portal by using classic Azure Active Directory, see [How to authorize developer accounts using Azure Active Directory](api-management-howto-aad.md).
22
26
23
27
## Prerequisites
@@ -47,7 +51,9 @@ In this section, you'll create a user flow in your Azure Active Directory B2C te
47
51
48
52
1. In a separate [Azure portal](https://portal.azure.com) tab, navigate to your API Management instance.
49
53
1. Under **Developer portal**, select **Identities** > **+ Add**.
50
-
1. In the **Add identity provider** page, select **Azure Active Directory B2C**.
54
+
1. In the **Add identity provider** page, select **Azure Active Directory B2C**. Once selected, you'll be able to enter other necessary information.
55
+
* In the **Client library** dropdown, select **MSAL**.
56
+
* To add other settings, see steps later in the article.
51
57
1. In the **Add identity provider** window, copy the **Redirect URL**.
@@ -56,7 +62,7 @@ In this section, you'll create a user flow in your Azure Active Directory B2C te
56
62
1. In the **Register an application** page, enter your application's registration information.
57
63
* In the **Name** section, enter an application name of your choosing.
58
64
* In the **Supported account types** section, select **Accounts in any identity provider or organizational directory (for authenticating users with user flows)**. For more information, see [Register an application](../active-directory/develop/quickstart-register-app.md#register-an-application).
59
-
* In **Redirect URI**, enter the Redirect URL your copied from your API Management instance.
65
+
* In **Redirect URI**, select **Single-page application (SPA)** and paste the redirect URL you saved from a previous step.
60
66
* In **Permissions**, select **Grant admin consent to openid and offline_access permissions.**
61
67
* Select **Register** to create the application.
62
68
@@ -82,9 +88,27 @@ In this section, you'll create a user flow in your Azure Active Directory B2C te
1. After you've specified the desired configuration, select **Add**.
91
+
1. Republish the developer portal for the Azure AD B2C configuration to take effect. In the left menu, under **Developer portal**, select **Portal overview** > **Publish**.
85
92
86
93
After the changes are saved, developers will be able to create new accounts and sign in to the developer portal by using Azure Active Directory B2C.
87
94
95
+
## Migrate to MSAL
96
+
97
+
If you previously configured an Azure AD B2C app for user sign-in using the ADAL, you can use the portal to migrate the app to MSAL and update the identity provider in API Management.
98
+
99
+
### Update Azure AD B2C app for MSAL compatibility
100
+
101
+
For steps, see [Switch redirect URIs to the single-page application type](../active-directory/develop/migrate-spa-implicit-to-auth-code.md#switch-redirect-uris-to-spa-platform).
102
+
103
+
### Update identity provider configuration
104
+
105
+
1. In the left menu of your API Management instance, under **Developer portal**, select **Identities**.
106
+
1. Select **Azure Active Directory B2C** from the list.
107
+
1. In the **Client library** dropdown, select **MSAL**.
108
+
1. Select **Update**.
109
+
1.[Republish your developer portal](api-management-howto-developer-portal-customize.md#publish-from-the-azure-portal).
Copy file name to clipboardExpand all lines: articles/api-management/api-management-howto-aad.md
+32-14Lines changed: 32 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ description: Learn how to enable user sign-in to the API Management developer po
6
6
author: dlepow
7
7
ms.service: api-management
8
8
ms.topic: article
9
-
ms.date: 05/20/2022
9
+
ms.date: 07/12/2022
10
10
ms.author: danlep
11
11
---
12
12
@@ -17,6 +17,10 @@ In this article, you'll learn how to:
17
17
> * Enable access to the developer portal for users from Azure Active Directory (Azure AD).
18
18
> * Manage groups of Azure AD users by adding external groups that contain the users.
19
19
20
+
> [!IMPORTANT]
21
+
> * This article has been updated with steps to configure an Azure AD app using the Microsoft Authentication Library ([MSAL](../active-directory/develop/msal-overview.md)).
22
+
> * If you previously configured an Azure AD app for user sign-in using the Azure AD Authentication Library (ADAL), we recommend that you [migrate to MSAL](#migrate-to-msal).
23
+
20
24
## Prerequisites
21
25
22
26
- Complete the [Create an Azure API Management instance](get-started-create-service-instance.md) quickstart.
@@ -55,10 +59,9 @@ After the Azure AD provider is enabled:
55
59
56
60
1. In the left menu of your API Management instance, under **Developer portal**, select **Identities**.
57
61
1. Select **+Add** from the top to open the **Add identity provider** pane to the right.
58
-
1. Under **Type**, select **Azure Active Directory** from the drop-down menu.
59
-
* Once selected, you'll be able to enter other necessary information.
60
-
* Information includes **Client ID** and **Client secret**.
61
-
* See more information about these controls later in the article.
62
+
1. Under **Type**, select **Azure Active Directory** from the drop-down menu. Once selected, you'll be able to enter other necessary information.
63
+
* In the **Client library** dropdown, select **MSAL**.
64
+
* To add **Client ID** and **Client secret**, see steps later in the article.
62
65
1. Save the **Redirect URL** for later.
63
66
64
67
:::image type="content" source="media/api-management-howto-aad/api-management-with-aad001.png" alt-text="Screenshot of adding identity provider in Azure portal.":::
@@ -75,14 +78,14 @@ After the Azure AD provider is enabled:
75
78
1. Select **New registration**. On the **Register an application** page, set the values as follows:
76
79
77
80
* Set **Name** to a meaningful name such as *developer-portal*
78
-
* Set **Supported account types** to **Accounts in this organizational directory only**.
79
-
* In **Redirect URI**, select **Web** and paste the redirect URL you saved from a previous step.
81
+
* Set **Supported account types** to **Accounts in any organizational directory**.
82
+
* In **Redirect URI**, select **Single-page application (SPA)** and paste the redirect URL you saved from a previous step.
80
83
* Select **Register**.
81
84
82
85
1. After you've registered the application, copy the **Application (client) ID** from the **Overview** page.
83
86
1. Switch to the browser tab with your API Management instance.
84
87
1. In the **Add identity provider** window, paste the **Application (client) ID** value into the **Client ID** box.
85
-
1. Switch to the browser tab with the App Registration.
88
+
1. Switch to the browser tab with the App registration.
86
89
1. Select the appropriate app registration.
87
90
1. Under the **Manage** section of the side menu, select **Certificates & secrets**.
88
91
1. From the **Certificates & secrets** page, select the **New client secret** button under **Client secrets**.
@@ -122,6 +125,23 @@ After the Azure AD provider is enabled:
122
125
* Optionally configure other sign-in settings by selecting **Identities** > **Settings**. For example, you might want to redirect anonymous users to the sign-in page.
123
126
* Republish the developer portal after any configuration change.
124
127
128
+
## Migrate to MSAL
129
+
130
+
If you previously configured an Azure AD app for user sign-in using the ADAL, you can use the portal to migrate the app to MSAL and update the identity provider in API Management.
131
+
132
+
### Update Azure AD app for MSAL compatibility
133
+
134
+
For steps, see [Switch redirect URIs to the single-page application type](../active-directory/develop/migrate-spa-implicit-to-auth-code.md#switch-redirect-uris-to-spa-platform).
135
+
136
+
### Update identity provider configuration
137
+
138
+
1. In the left menu of your API Management instance, under **Developer portal**, select **Identities**.
139
+
1. Select **Azure Active Directory** from the list.
140
+
1. In the **Client library** dropdown, select **MSAL**.
141
+
1. Select **Update**.
142
+
1.[Republish your developer portal](api-management-howto-developer-portal-customize.md#publish-from-the-azure-portal).
143
+
144
+
125
145
## Add an external Azure AD group
126
146
127
147
Now that you've enabled access for users in an Azure AD tenant, you can:
@@ -135,9 +155,9 @@ Follow these steps to grant:
135
155
1. Update the first 3 lines of the following Azure CLI script to match your environment and run it.
$tenantId = "Your Azure AD Tenant or Organization ID" # Example: 0e054eb4-e5d0-43b8-ba1e-d7b5156f6da8"
160
+
$appObjectID = "Application Object ID that has been registered in AAD" # Example: "2215b54a-df84-453f-b4db-ae079c0d2619"
141
161
#Login and Set the Subscription
142
162
az login
143
163
az account set --subscription $subId
@@ -210,10 +230,8 @@ Your user is now signed in to the developer portal for your API Management servi
210
230
211
231
## Next Steps
212
232
213
-
- Learn how to [Protect your web API backend in API Management by using OAuth 2.0 authorization with Azure AD](./api-management-howto-protect-backend-with-aad.md)
214
233
- Learn more about [Azure Active Directory and OAuth2.0](../active-directory/develop/authentication-vs-authorization.md).
215
-
- Check out more [videos](https://azure.microsoft.com/documentation/videos/index/?services=api-management) about API Management.
216
-
- For other ways to secure your back-end service, see [Mutual Certificate authentication](./api-management-howto-mutual-certificates.md).
234
+
- Learn more about [MSAL](../active-directory/develop/msal-overview.md) and [migrating to MSAL](../active-directory/develop/msal-migration.md).
217
235
-[Create an API Management service instance](./get-started-create-service-instance.md).
218
236
-[Manage your first API](./import-and-publish.md).
0 commit comments