Skip to content

Commit 693325b

Browse files
author
gitName
committed
draft
1 parent a58fff4 commit 693325b

File tree

1 file changed

+41
-28
lines changed

1 file changed

+41
-28
lines changed

articles/api-management/applications.md

Lines changed: 41 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ ms.custom:
1616

1717
[!INCLUDE [api-management-availability-premium-dev-standard-basic](../../includes/api-management-availability-premium-dev-standard-basic.md)]
1818

19-
API Management is introducing built-in OAuth 2.0 application-based access to products using the client credentials flow.
19+
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 secure OAuth 2.0-based access to APIs managed in API Management.
2020

21-
With this feature, an API manager configures an application in Microsoft Entra ID to represent a product, and registers a client application in Microsoft Entra ID that restricts access to the product's APIs. A developer (or client app) can then use the OAuth 2.0 client credentials flow to obtain OAuth tokens from the client application that are passed to the API Management gateway for authorization to the product's APIs.
21+
With this feature, an API manager configures an application in Microsoft Entra ID to represent a product, and registers a client application in Microsoft Entra ID that restricts access to the product's APIs. Developers obtain credentials from the developer portal to generate OAuth 2.0 tokens from Microsoft Entra ID. 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.
2222

2323
> [!NOTE]
2424
> This feature is in private preview. Ensure that you have received instructions to access the preview and that your subscription allows you to create an API Management instance in an Early Updates Access Program (EUAP) region. See detailed [Prerequisites](#prerequisites).
@@ -28,8 +28,9 @@ This article describes the following steps:
2828

2929
* Enable application-based access for a product in API Management.
3030
* Create a client application in API Management that restricts access to the product.
31+
* View the client application in the developer portal and get credentials to the product's APIs.
3132
* Test OAuth 2.0 token-based access the product's associated API.
32-
* View the client application in the developer portal and get secure access to the product's APIs.
33+
3334

3435
<!-- Clarify personas
3536
This feature enables:
@@ -75,7 +76,7 @@ This feature enables:
7576

7677
1. Assign the identity the **Application Administrator** RBAC role in Microsoft Entra ID. To assign the role:
7778

78-
1. Sign in to the portal and navigate to **Microsoft Entra**
79+
1. Sign in to the portal and navigate to **Microsoft Entra ID**.
7980
1. In the left menu, select **Manage** > **Roles and administrators**.
8081
1. Select **Application administrator**.
8182
1. In the left menu, select **Manage** > **Assignments** > **+ Add assignments**.
@@ -84,7 +85,9 @@ This feature enables:
8485

8586
## Enable application based access for product
8687

87-
Follow these steps to enable **Application based access** for a product. Enabling this setting automatically creates an application in Microsoft Entra ID to represent the selected product.
88+
Follow these steps to enable **Application based access** for a product. Enabling this setting automatically creates an application in Microsoft Entra ID to represent the selected product.
89+
90+
The following example uses the **Starter** product, but choose any published product that has at least one API assigned to it.
8891

8992

9093
1. Sign in to the [Azure portal](https://portal.azure.com) and navigate to your API Management instance.
@@ -101,14 +104,15 @@ Follow these steps to enable **Application based access** for a product. Enablin
101104
102105
## Review product application settings
103106

104-
After you enable application based access, an enterprise application is created.
107+
Enabling application based access create an enterprise application in Microsoft Entra ID to represent the product.
105108

106-
The application is named with the following format: **APIMProductApplication<product-name>**. For example, if the product name is **Starter**, the application name is **APIMProductApplicationStarter**. The application should have an **App role** defined.
109+
The application is named with the following format: **APIMProductApplication<product-name>**. For example, if the product name is **Starter**, the application name is **APIMProductApplicationStarter**. The application has an **App role** defined.
107110

108111
You can review application settings in **App registrations**.
109112

110-
1. Sign in to the Azure portal and navigate to **App registrations**.
111-
1. Select **All applications** and search for the application created by API Management.
113+
1. Sign in to the Azure portal and navigate to **Microsoft Entra ID** > **Manage** > **App registrations**.
114+
1. Select **All applications**.
115+
1. Search for and select the application created by API Management.
112116
1. In the left menu, under **Manage**, select **App roles**.
113117
1. Confirm that an application role was set by Azure API Management, as shown in the following screenshot:
114118

@@ -118,11 +122,14 @@ You can review application settings in **App registrations**.
118122

119123
Now create a client application that will be registered in Microsoft Entra ID and restricts to access one or more products.
120124

121-
* Products must have **Application based access** enabled to be associated with a client application.
122-
* Each client application is associated with a single user (owner) in the API Management instance.
125+
* A product must have **Application based access** enabled to be associated with the client application.
126+
* Each client application has a single user (owner) in the API Management instance that can access product APIs through the application.
123127
* A product can be associated with more than one client application.
124128

125-
1. Sign in to the Azure portal at the following URL (`https://portal.azure.com/?showversion=true&feature.customPortal=false&Microsoft_Azure_ApiManagement=javierbo2&applicationNewRoleValueFormat=true`) and navigate to your API Management instance.
129+
1. Sign in to the Azure portal at the following test URL:
130+
131+
[`https://portal.azure.com/?showversion=true&feature.customPortal=false&Microsoft_Azure_ApiManagement=javierbo2&applicationNewRoleValueFormat=true`](https://portal.azure.com/?showversion=true&feature.customPortal=false&Microsoft_Azure_ApiManagement=javierbo2&applicationNewRoleValueFormat=true)
132+
1. Navigate to your API Management instance.
126133
1. In the left menu, under **APIs**, select **Applications** > **+ Register application**.
127134
1. In the **Register an application** pane, enter the following application settings:
128135
* **Name**: Enter a name for the application.
@@ -133,40 +140,44 @@ Now create a client application that will be registered in Microsoft Entra ID an
133140
:::image type="content" source="media/applications/register-application.png" alt-text="Screenshot of application settings in the portal.":::
134141
1. Select **Register**.
135142

136-
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.
143+
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.
137144

138145
<!-- Where would client secret show? Should customer store it somewhere? -->
139146

140147
## Review client application settings
141148

142149
Review the settings for the client application in Microsoft Entra ID.
143150

144-
The application is named with the following format: **xxxxxxTBD**. For example, if the product name is **Starter**, the application name is **APIMProductApplicationStarter**. The application should have an **App role** defined.
145-
151+
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**.
146152
You can review application settings in **App registrations**.
147153

148-
1. Sign in to the Azure portal and navigate to **App registrations**.
149-
1. Select **All applications** and search for the application created by API Management.
150-
1. In the left menu, under **Manage**, select **App roles**.
151-
1. Confirm that an application role was set by Azure API Management, as shown in the following screenshot:
154+
1. Sign in to the Azure portal and navigate to **Microsoft Entra ID** > **Manage** > **App registrations**.
155+
1. Select **All applications**.
156+
1. Search for and select the client application created by API Management.
157+
1. In the left menu, under **Manage**, select **API permissions**.
158+
1. Confirm that the application has permissions to access the backend product applications.
159+
160+
For example, if the client application grants access to the **Starter** product, the application has **Product.Starter.All** permissions to access the **APIMProductApplicationStarter** application.
161+
162+
<!-- Insert screenshot -->
152163

153164

154165
## Create token and use with API call
155166

156167

157-
Run the following Azure PowerShell scripts to obtain a token generated for the client application and to call a product API using the token.
168+
Run the following Azure PowerShell scripts to call the client application to generate a token, then use the token to call a product API in API Management.
158169

159170
<!-- Warn about secure handling of token and secrets -->
160171

161-
### Obtain token for client application
172+
### Call client application to generate token
162173
```powershell
163174
164175
# Replace placeholder values with your own values.
165176
166-
$clientId = "aa8029d8-83a5-4713-939d-cebac1bbd672" # Client (application) ID of client application
167-
$clientSecret = "xxxxx" # Retrieve secret of client application in developer portal
168-
$scopeOfOtherApp = "api://03db2e9e-efe9-4f68-b74d-911966d1a684/.default" # Audience of application audience is visible under a product
169-
$tenantId = "e74bd0b5-f803-4e01-858b-dba7e58e55cf" # Your tenant id
177+
$clientId = "00001111-aaaa-2222-bbbb-3333cccc4444" # Client (application) ID of client application
178+
$clientSecret = "******" # Retrieve secret of client application in developer portal
179+
$scopeOfOtherApp = "api://055556666-ffff-7777-aaaa-8888bbbb9999/.default" # Value of Audience in product properties
180+
$tenantId = "aaaabbbb-0000-cccc-1111-dddd2222eeee" # Your tenant id
170181
171182
$body = @{
172183
    grant_type    = "client_credentials"
@@ -181,7 +192,7 @@ $token
181192

182193
### Call product API using token
183194

184-
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.
195+
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.
185196

186197
```powershell
187198
@@ -200,11 +211,13 @@ Write-Host "Response:"
200211
$getresponse | ConvertTo-Json -Depth 5
201212
```
202213

203-
204214
## List applications and get secrets in the developer portal
205215

216+
[TBD]
217+
206218

207219
## Related content
208220

209-
* Add link here
221+
* [Create and publish a product](api-management-howto-add-products.md)
222+
* [Authentication and authorization to APIs in API Management](authentication-authorization-overview.md)
210223

0 commit comments

Comments
 (0)