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/applications.md
+24-55Lines changed: 24 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
1
---
2
2
title: Create OAuth 2.0 Application for Access to Product APIs - Azure API Management
3
3
titleSuffix: Azure API Management
4
-
description: Learn how to configure OAuth 2.0 application-based access to products in Azure API Management, including prerequisites and step-by-step guidance.
4
+
description: Learn how to configure OAuth 2.0 application-based access to product APIs in Azure API Management.
5
5
services: api-management
6
6
author: dlepow
7
7
8
8
ms.service: azure-api-management
9
9
ms.topic: how-to
10
-
ms.date: 05/13/2025
10
+
ms.date: 05/16/2025
11
11
ms.author: danlep
12
12
ms.custom:
13
13
---
@@ -18,35 +18,18 @@ ms.custom:
18
18
19
19
API Management now supports built-in OAuth 2.0 application-based access to product APIs using the client credentials flow. This feature allows API managers to register applications, streamlining secure API access for developers through OAuth 2.0 authorization.
20
20
21
+
> [!NOTE]
22
+
> Applications are currently in limited preview. To sign up, fill [this form](https://aka.ms/apimappspreview).
23
+
21
24
With this feature:
22
25
23
26
* API managers set a product property to enable application-based access.
24
27
* API managers register client applications in Microsoft Entra ID to limit access to specific products.
25
-
<!--
26
-
* Developers access the developer portal to retrieve client application credentials.
27
-
-->
28
28
* Using the OAuth 2.0 client credentials flow, developers or apps obtain tokens that they can include in API requests. These tokens are validated by the API Management gateway to authorize access to the product's APIs.
29
29
30
-
> [!IMPORTANT]
31
-
> This feature is in private preview. Ensure that you can create an API Management instance in an Early Updates Access Program (EUAP) region. See detailed [Prerequisites](#prerequisites).
32
-
>
33
-
34
-
35
-
<!-- Clarify personas
36
-
This feature enables:
37
-
38
-
* API Management gateway can now authorize product/API access using OAuth token **in client credentials flow**
39
-
* API managers can identify products which have OAuth authorization enabled
40
-
* API managers can create client applications and assign access to products
41
-
* Developers can view all client applications and use OAuth token to get secure access to product/API
42
-
-->
43
-
44
30
## Prerequisites
45
31
46
-
- An API Management instance deployed in one of the Azure Early Updates Access Program (EUAP) regions, such as Central US EUAP. If you need to deploy an instance, see [Create an API Management service instance](get-started-create-service-instance.md). The API Management instance must be in the **Premium**, **Standard**, **Basic**, or **Developer** tier.
47
-
48
-
> [!NOTE]
49
-
> If you don't have access to an EUAP region, you can [request it](/troubleshoot/azure/general/region-access-request-process) through the Azure portal.
32
+
- An API Management instance deployed in the **Premium**, **Standard**, **Basic**, or **Developer** tier. If you need to deploy an instance, see [Create an API Management service instance](get-started-create-service-instance.md).
50
33
51
34
- At least one product in your API Management instance, with at least one API assigned to it.
52
35
* The product should be in the **Published** state so that it can be accessed by developers through the developer portal.
<!-- Clarify personas for API Management and developer portal. -->
63
-
64
45
## Configure managed identity
65
46
66
47
1. Enable a system-assigned [managed identity for API Management](api-management-howto-use-managed-service-identity.md) in your API Management instance.
67
48
68
49
1. Assign the identity the **Application Administrator** RBAC role in Microsoft Entra ID. To assign the role:
69
50
70
-
1. Sign in to the portal and navigate to **Microsoft Entra ID**.
51
+
1. Sign in to the [portal](https://portal.azure.com) and navigate to **Microsoft Entra ID**.
71
52
1. In the left menu, select **Manage** > **Roles and administrators**.
72
53
1. Select **Application administrator**.
73
54
1. In the left menu, select **Manage** > **Assignments** > **+ Add assignments**.
74
-
1. In the **Add assignments** page, search for the API Management instance's managed identity by name (the name of the API Management instance), select it, and then select **Add**.
55
+
1. In the **Add assignments** page, search for the API Management instance's managed identity by name (the name of the API Management instance). Select the managed identity, and then select **Add**.
75
56
76
57
## Enable application based access for product
77
58
78
59
Follow these steps to enable **Application based access** for a product. A product must have this setting enabled to be associated with a client application in later steps.
79
60
80
61
The following example uses the **Starter** product, but choose any published product that has at least one API assigned to it.
81
62
82
-
1. Sign in to the Azure portal at the following test URL:
1. Sign in to the [portal](https://portal.azure.com) and navigate to your API Management instance.
86
64
1. In the left menu, under **APIs**, select **Products**.
87
-
1. Choose the product you want to configure, such as the **Starter** product.
65
+
1. Choose the product that you want to configure, such as the **Starter** product.
88
66
1. In the left menu, under **Product**, select **Properties**.
89
67
1. Enable the **Application based access** setting.
90
-
1. Optionally, you can also enable the **Requires subscription** setting. If you enable both settings, the API Management gateway can accept either OAuth 2.0 authorization or a subscription key for access to the product's APIs.
68
+
1. Optionally, enable the **Requires subscription** setting. If you enable both settings, the API Management gateway can accept either OAuth 2.0 authorization or a subscription key for access to the product's APIs.
91
69
1. Select **Save**.
92
70
93
71
:::image type="content" source="media/applications/enable-application-based-access.png" alt-text="Screenshot of enabling application based access in the portal.":::
94
72
95
73
> [!TIP]
96
74
> You can also enable the **Application based access** setting when creating a new product.
97
75
98
-
Enabling application based access creates a backend enterprise application in Microsoft Entra ID to represent the product. The backend application ID is displayed in the product's **Properties** page.
76
+
Enabling application based access creates a backend enterprise application in Microsoft Entra ID to represent the product. The backend application ID is displayed in the product's **Properties** page.
99
77
100
78
:::image type="content" source="media/applications/product-application-settings.png" alt-text="Screenshot of product's application settings in the portal.":::
101
79
102
-
This application ID is set as the **Audience** value when creating a client application to access the product. Also use this value when generating a token to call the product API.
80
+
> [!NOTE]
81
+
> This application ID is set as the **Audience** value when creating a client application to access the product. Also use this value when generating a token to call the product API.
82
+
>
103
83
104
84
## (Optional) Review product application settings in Microsoft Entra ID
105
85
@@ -109,12 +89,11 @@ The application is named with the following format: **APIMProductApplication\<pr
109
89
110
90
To review application settings in **App registrations**:
111
91
112
-
1. Sign in to the Azure portal and navigate to **Microsoft Entra ID** > **Manage** > **App registrations**.
92
+
1. Sign in to the [portal](https://portal.azure.com) and navigate to **Microsoft Entra ID** > **Manage** > **App registrations**.
113
93
1. Select **All applications**.
114
94
1. Search for and select the application created by API Management.
115
-
1. On the **Overview** page, note the **Application (client) ID**. This ID is set as the **Audience** value when creating a client application to access the product.
116
95
1. In the left menu, under **Manage**, select **App roles**.
117
-
1. Confirm that an application role was set by Azure API Management, as shown in the following screenshot:
96
+
1. Confirm the application role that set by Azure API Management, as shown in the following screenshot:
118
97
119
98
:::image type="content" source="media/applications/application-roles.png" alt-text="Screenshot of app roles in the portal.":::
120
99
@@ -123,18 +102,15 @@ To review application settings in **App registrations**:
123
102
Now register a client application that limits access to one or more products.
124
103
125
104
* A product must have **Application based access** enabled to be associated with a client application.
126
-
* Each client application has a single user (owner) in the API Management instance that can access product APIs through the application.
105
+
* Each client application has a single user (owner) in the API Management instance. One the owner can access product APIs through the application.
127
106
* A product can be associated with more than one client application.
128
107
129
-
1. Sign in to the Azure portal at the following test URL:
1. Sign in to the [portal](https://portal.azure.com) and navigate to your API Management instance.
133
109
1. In the left menu, under **APIs**, select **Applications** > **+ Register application**.
134
110
1. In the **Register an application** page, enter the following application settings:
135
111
***Name**: Enter a name for the application.
136
112
***Owner**: Select the owner of the application from the dropdown list of users in the API Management instance.
137
-
***Grant access to selected products**: Select one or more products in the API Management instance that you previously enabled for **Application based access**.
113
+
***Grant access to selected products**: Select one or more products in the API Management instance that were previously enabled for **Application based access**.
138
114
***Description**: Optionally enter a description.
139
115
140
116
:::image type="content" source="media/applications/register-application.png" alt-text="Screenshot of application settings in the portal.":::
@@ -143,7 +119,7 @@ Now register a client application that limits access to one or more products.
143
119
The application is added to the list of applications on the **Applications** page. Select the application to view details such as the **Client ID**. You need this ID to generate a token to call the product API.
144
120
145
121
> [!TIP]
146
-
> * After creating an application, you can associate it with other products. Select the application on the **Applications** page, and then select **Details** > **Products****+ Add product**.
122
+
> * After creating an application, optionally associate it with other products. Select the application on the **Applications** page, and then select **Details** > **Products****+ Add product**.
147
123
> * You can also create or associate an application by editing a product from the **Products** page.
148
124
149
125
## Generate client secret
@@ -165,7 +141,7 @@ The application is named with the following format: **APIMApplication\<product-n
165
141
166
142
To review application settings in **App registrations**:
167
143
168
-
1. Sign in to the Azure portal and navigate to **Microsoft Entra ID** > **Manage** > **App registrations**.
144
+
1. Sign in to the [portal](https://portal.azure.com) and navigate to **Microsoft Entra ID** > **Manage** > **App registrations**.
169
145
1. Select **All applications**.
170
146
1. Search for and select the client application created by API Management.
171
147
1. In the left menu, under **Manage**, select **API permissions**.
@@ -175,19 +151,12 @@ To review application settings in **App registrations**:
175
151
176
152
:::image type="content" source="media/applications/client-api-permissions.png" alt-text="Screenshot of API permissions in the portal.":::
177
153
178
-
<!--
179
-
180
-
## List applications and get secrets in the developer portal
181
-
182
-
[TBD]
183
-
-->
184
-
185
154
186
155
## Create token and use with API call
187
156
188
-
After you enable application-based access for a product and create a client application in API Management, a developer or app can generate a token to call the product's APIs. The token must be included in the `Authorization` header of a request.
157
+
After you enable application-based access for a product and register a client application, a developer or app can generate a token to call the product's APIs. The token must be included in the `Authorization` header of a request.
189
158
190
-
For example, a developer or client app can run the following Azure PowerShell scripts to call the client application to generate a token, and then use the token to call a product API in API Management.
159
+
For example, a developer or app can run the following Azure PowerShell scripts to call the client application to generate a token, and then use the token to call a product API in API Management.
191
160
192
161
> [!CAUTION]
193
162
> The following scripts are examples for testing purposes only. In production, use a secure method to store and retrieve the client secret.
0 commit comments