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
+25-28Lines changed: 25 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,37 +1,37 @@
1
1
---
2
-
title: Create OAuth 2.0 application to access product APIs - Azure API Management
2
+
title: Create OAuth 2.0 Application for Access to Product APIs - Azure API Management
3
3
titleSuffix: Azure API Management
4
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.
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/06/2025
10
+
ms.date: 05/08/2025
11
11
ms.author: danlep
12
12
ms.custom:
13
13
---
14
14
15
-
# Create and authorize access to products using OAuth 2.0 application
15
+
# Register an OAuth 2.0 application for access to product APIs
API Management is introducing built-in OAuth 2.0 application-based access to products using the client credentials flow. API managers and developers can use applications to simplify securing access to APIs using OAuth 2.0 authorization.
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
21
With this feature:
22
22
23
-
*An API manager configures a product to use applicationbased access, and registers a client application in Microsoft Entra ID that restricts access to the product's APIs.
24
-
* Developers obtain application credentials from the developer portal to generate OAuth 2.0 tokens from Microsoft Entra ID.
25
-
*A developer (or client app) can then use the OAuth 2.0 client credentials flow to obtain OAuth 2.0 tokens that are passed to the API Management gateway for authorization to the product's APIs.
23
+
* API managers configure products in API Management to enable application-based access. They also register client applications in Microsoft Entra ID to limit access to specific products.
24
+
* Developers access the developer portal to retrieve application credentials, which are used to secure access to product APIs.
25
+
*Using the OAuth 2.0 client credentials flow, developers or client applications obtain tokens that are included in API requests. These tokens are validated by the API Management gateway to authorize access to the product's APIs.
26
26
27
27
> [!IMPORTANT]
28
28
> 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).
29
29
>
30
30
31
31
This article describes the following steps:
32
32
33
-
* Enable application-based access for a product in API Management
34
-
* Create a client application in API Management that restricts access to the product
33
+
* Enable application-based access for an API Management product
34
+
* Create a client application that limits access to the product
35
35
* View the client application in the developer portal and get credentials to the product's APIs
36
36
* Test OAuth 2.0 token-based access to the product's associated API
37
37
@@ -47,15 +47,17 @@ This feature enables:
47
47
48
48
## Prerequisites
49
49
50
-
- An API Management instance deployed in one of the Azure Early Updates Access Program (EUAP) regions, such as Central US EUAP. To create an API Management service 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.
50
+
- 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.
51
51
52
52
> [!NOTE]
53
53
> 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.
54
54
55
-
- At least one product in your API Management instance, with at least one API assigned to it. If you haven't yet created a product, see [Create and publish a product](api-management-howto-add-products.md).
56
-
For testing, you can use the default **Starter** product and the **Echo** API that's added to it. The product should be in the **Published** state so that it can be accessed by developers through the developer portal.
55
+
- At least one product in your API Management instance, with at least one API assigned to it.
56
+
* The product should be in the **Published** state so that it can be accessed by developers through the developer portal.
57
+
* For testing, you can use the default **Starter** product and the **Echo** API that's added to it.
58
+
* If you want to create a product, see [Create and publish a product](api-management-howto-add-products.md).
57
59
58
-
- Sufficient permissions tenant to assign the **Application Administrator** role in Microsoft Entra, which requires at least the **Privileged Role Administrator** role.
60
+
- Sufficient permissions tenant to assign the **Application Administrator** role in Microsoft Entra ID, which requires at least the **Privileged Role Administrator** role.
59
61
60
62
- Optionally, add one or more [users](api-management-howto-create-or-invite-developers.md) in your API Management instance.
61
63
@@ -66,17 +68,14 @@ This feature enables:
66
68
## Configure managed identity
67
69
68
70
1. Enable a system-assigned [managed identity for API Management](api-management-howto-use-managed-service-identity.md) in your API Management instance.
69
-
70
-
* Take note of the identity's **Object (principal) ID**.
71
-
71
+
72
72
1. Assign the identity the **Application Administrator** RBAC role in Microsoft Entra ID. To assign the role:
73
73
74
74
1. Sign in to the portal and navigate to **Microsoft Entra ID**.
75
75
1. In the left menu, select **Manage** > **Roles and administrators**.
76
76
1. Select **Application administrator**.
77
77
1. In the left menu, select **Manage** > **Assignments** > **+ Add assignments**.
78
-
1. In the **Add assignments** pane, search for the API Management instance's managed identity by name or object (principal) ID, select it, and then select **Add**.
79
-
78
+
1. In the **Add assignments** pane, search for the API Management instance's managed identity by name (the name of the API Management instance), select it, and then select **Add**.
80
79
81
80
## Enable application based access for product
82
81
@@ -115,7 +114,7 @@ Review application settings in **App registrations**:
115
114
116
115
## Create client application to access product
117
116
118
-
Now create a client application that is registered in Microsoft Entra ID and restricts access to one or more products.
117
+
Now create a client application that is registered in Microsoft Entra ID and limits access to one or more products.
119
118
120
119
* A product must have **Application based access** enabled to be associated with a client application.
121
120
* Each client application has a single user (owner) in the API Management instance that can access product APIs through the application.
@@ -129,20 +128,18 @@ Now create a client application that is registered in Microsoft Entra ID and res
129
128
1. In the **Register an application** pane, enter the following application settings:
130
129
***Name**: Enter a name for the application.
131
130
***Owner**: Select the owner of the application from the dropdown list of users in the API Management instance.
132
-
***Grant access to selected products**: Select one or more products in the API Management instance that have **Application based access**enabled, such as the **Starter** product (see [Enable application based access for product](#enable-application-based-access-for-product)).
131
+
***Grant access to selected products**: Select one or more products in the API Management instance that you previously enabled for **Application based access**.
133
132
***Description**: Optionally enter a description.
134
133
135
134
:::image type="content" source="media/applications/register-application.png" alt-text="Screenshot of application settings in the portal.":::
136
135
1. Select **Register**.
137
136
138
-
The application is added to the list of applications on the **Applications** pane. A client secret is automatically generated for the application. The client secret is used to obtain an OAuth token from the client application in the client credentials flow.
137
+
The application is added to the list of applications on the **Applications** pane. A client secret is automatically generated for the application. The client secret is used to obtain an OAuth 2.0 token from the client application in the client credentials flow.
139
138
140
139
<!-- Where would client secret show? Should customer store it somewhere? -->
141
140
142
141
## Review client application settings
143
142
144
-
Review the settings for the client application in Microsoft Entra ID.
145
-
146
143
The application is named with the following format: **APIMApplication\<product-name\>**. For example, if the product name is **Starter**, the application name is similar to **APIMApplicationStarter**.
147
144
148
145
Review application settings in **App registrations**:
@@ -155,8 +152,7 @@ Review application settings in **App registrations**:
155
152
156
153
For example, if the client application grants access to the **Starter** product, the application has **Product.Starter.All** permissions to access the **APIMProductApplicationStarter** application.
157
154
158
-
<!-- Insert screenshot -->
159
-
155
+
:::image type="content" source="media/applications/client-api-permissions.png" alt-text="Screenshot of API permissions in the portal.":::
160
156
161
157
## List applications and get secrets in the developer portal
The token generated in the previous step is used to call a product API. The token is passed in the **Authorization** header of the request. The API Management instance validates the token and authorizes access to the API. The following is an example call to the echo API.
192
+
The token generated in the previous step is used to call a product API. The token is passed in the **Authorization** header of the request. The API Management instance validates the token and authorizes access to the API.
193
+
194
+
The following script shows an example call to the echo API.
197
195
198
196
```powershell
199
197
200
198
# Gatewate endpoint to call. Update with URI of API operation you want to call.
0 commit comments