Skip to content

Commit a4a4259

Browse files
Merge pull request #292668 from dlepow/tcuuf
[APIM][UUF] Refresh OAuth for test console
2 parents e038573 + c2a5f7f commit a4a4259

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

articles/api-management/api-management-howto-oauth2.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
title: Authorize test console of API Management developer portal using OAuth 2.0
2+
title: Authorize test console of API Management developer portal - OAuth 2.0
33
titleSuffix: Azure API Management
4-
description: Set up OAuth 2.0 user authorization for the test console in the Azure API Management developer portal. This example uses Microsoft Entra ID as an OAuth 2.0 provider.
4+
description: Set up OAuth 2.0 user authorization for the test console in Azure API Management developer portal. This example uses Microsoft Entra ID as OAuth 2.0 provider.
55
services: api-management
66
author: dlepow
77

88
ms.service: azure-api-management
9-
ms.topic: article
10-
ms.date: 04/01/2024
9+
ms.topic: how-to
10+
ms.date: 01/06/2025
1111
ms.author: danlep
1212
ms.custom: engagement-fy23
1313
---
@@ -22,6 +22,9 @@ Configuring OAuth 2.0 user authorization in the test console of the developer po
2222

2323
## Prerequisites
2424

25+
- An API Management instance.
26+
- An OAuth 2.0 provider.
27+
2528
This article shows you how to configure your API Management service instance to use OAuth 2.0 authorization in the developer portal's test console, but it doesn't show you how to configure an OAuth 2.0 provider.
2629

2730
If you haven't yet created an API Management service instance, see [Create an API Management service instance][Create an API Management service instance].
@@ -55,7 +58,7 @@ This configuration supports the following OAuth flow:
5558

5659
1. A developer (user of the developer portal) makes an API call with the authorization header.
5760

58-
1. The token gets validated by using the `validate-jwt` policy in API Management by Microsoft Entra ID.
61+
1. The token gets validated with the OAuth 2.0 provider by using the `validate-jwt` policy. For the Microsoft Entra ID provider, API Management also provides the `validate-azure-ad-token` policy.
5962

6063
1. Based on the validation result, the developer will receive the response in the developer portal.
6164

@@ -81,7 +84,7 @@ Consider how the grant type generates a token, the token's [scope](https://oauth
8184

8285
When configuring OAuth 2.0 user authorization in the test console of the developer portal:
8386

84-
* **Limit the token's scope to the minimum** needed for developers to test the APIs. Limit the scope to the test console, or to the affected APIs. The steps to configure token scope depend on your OAuth 2.0 provider.
87+
* **Limit the token's scope to the minimum** needed for developers to test the APIs. Limit the scope to the test console, or to the affected APIs. The steps to configure token scope depend on your OAuth 2.0 provider. An example is shown later in this article using Microsoft Entra ID.
8588

8689
Depending on your scenarios, you may configure more or less restrictive token scopes for other client applications that you create to access backend APIs.
8790
* **Take extra care if you enable the Client Credentials flow**. The test console in the developer portal, when working with the Client Credentials flow, doesn't ask for credentials. An access token could be inadvertently exposed to developers or anonymous users of the developer console.
@@ -172,11 +175,11 @@ Now that you've registered two applications to represent the API and the test co
172175

173176
1. In the [Azure portal](https://portal.azure.com), search for and select **App registrations**.
174177

175-
1. Choose your client app. Then in the side menu, select **API permissions**.
178+
1. Choose your client-app. Then in the side menu, select **API permissions**.
176179

177-
1. Select **+ Add a Permission**.
180+
1. Select **+ Add a permission**.
178181

179-
1. Under **Select an API**, select **My APIs**, and then find and select your backend-app.
182+
1. Under **Select an API**, select **My APIs**, and then find and select your backend-app (the app registration for your backend API).
180183

181184
1. Select **Delegated Permissions**, then select the appropriate permissions to your backend-app.
182185

@@ -287,7 +290,7 @@ After saving the OAuth 2.0 server configuration, configure an API or APIs to use
287290

288291
In the configuration so far, API Management doesn't validate the access token. It only passes the token in the authorization header to the backend API.
289292

290-
To pre-authorize requests, configure a [validate-jwt](validate-jwt-policy.md) policy to validate the access token of each incoming request. If a request doesn't have a valid token, API Management blocks it.
293+
To pre-authorize requests, configure a [validate-jwt](validate-jwt-policy.md) policy to validate the access token of each incoming request. If a request doesn't have a valid token, API Management blocks it. When you use the Microsoft Entra ID provider, you can also use the [validate-azure-ad-token](validate-azure-ad-token-policy.md) policy.
291294

292295
[!INCLUDE [api-management-configure-validate-jwt](../../includes/api-management-configure-validate-jwt.md)]
293296

0 commit comments

Comments
 (0)