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-oauth2.md
+10-16Lines changed: 10 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,14 +98,10 @@ Throughout this tutorial you'll be asked to record key information to reference
98
98
99
99
You'll need to register two applications with your OAuth 2.0 provider: one represents the backend API to be protected, and a second represents the client application that calls the API - in this case, the test console of the developer portal.
100
100
101
-
The following are example steps using Azure AD as the OAuth 2.0 provider.
101
+
The following are example steps using Azure AD as the OAuth 2.0 provider. For details about app registration, see [Quickstart: Configure an application to expose a web API](../active-directory/develop/quickstart-configure-app-expose-web-apis.md).
102
102
103
103
### Register an application in Azure AD to represent the API
104
104
105
-
Using the Azure portal, register an application that represents the backend API in Azure AD.
106
-
107
-
For details about app registration, see [Quickstart: Configure an application to expose a web API](../active-directory/develop/quickstart-configure-app-expose-web-apis.md).
108
-
109
105
1. In the [Azure portal](https://portal.azure.com), search for and select **App registrations**.
110
106
111
107
1. Select **New registration**.
@@ -137,9 +133,7 @@ For details about app registration, see [Quickstart: Configure an application to
137
133
138
134
### Register another application in Azure AD to represent a client application
139
135
140
-
Register every client application that calls the API as an application in Azure AD. In this example, the client application is the **test console** in the API Management developer portal.
141
-
142
-
To register an application in Azure AD to represent the client application:
136
+
Register every client application that calls the API as an application in Azure AD.
143
137
144
138
1. In the [Azure portal](https://portal.azure.com), search for and select **App registrations**.
145
139
@@ -248,18 +242,18 @@ Optionally:
248
242
249
243
-`/signin-oauth/code/callback/{authServerName}` for authorization code grant flow
250
244
-`/signin-oauth/implicit/callback` for implicit grant flow
251
-
252
-
Copy the appropriate Redirect URI to the **Authentication** page of your client-app registration. In the app registration, select **Authentication** > **+ Add a platform** > **Web**, and then enter the Redirect URI.
253
245
254
246
:::image type="content" source="media/api-management-howto-oauth2/oauth-04.png" alt-text="Add client credentials for the OAuth 2.0 service":::
255
247
248
+
Copy the appropriate Redirect URI to the **Authentication** page of your client-app registration. In the app registration, select **Authentication** > **+ Add a platform** > **Web**, and then enter the Redirect URI.
249
+
256
250
1. If **Authorization grant types** is set to **Resource owner password**, the **Resource owner password credentials** section is used to specify those credentials; otherwise you can leave it blank.
257
251
258
252
1. Select **Create** to save the API Management OAuth 2.0 authorization server configuration.
259
253
260
254
1.[Republish](api-management-howto-developer-portal-customize.md#publish) the developer portal.
261
255
262
-
> [!NOTE]
256
+
> [!IMPORTANT]
263
257
> When making OAuth 2.0-related changes, be sure to to republish the developer portal after every modification as relevant changes (for example, scope change) otherwise cannot propagate into the portal and subsequently be used in trying out the APIs.
264
258
265
259
After saving the OAuth 2.0 server configuration, configure an API or APIs to use this configuration, as shown in the next section.
@@ -274,17 +268,18 @@ After saving the OAuth 2.0 server configuration, configure an API or APIs to use
## Configure a JWT validation policy to pre-authorize requests
278
276
279
-
In the preceding section, API Management doesn't validate the access token. It only passes the token in the authorization header to the backend API.
277
+
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.
280
278
281
279
To pre-authorize requests, configure a [validate-jwt](api-management-access-restriction-policies.md#ValidateJWT) policy to validate the access token of each incoming request. If a request doesn't have a valid token, API Management blocks it.
## Legacy developer portal - test the OAuth 2.0 user authorization
290
285
@@ -316,7 +311,6 @@ Once you've signed in, the **Request headers** are populated with an `Authorizat
316
311
317
312
At this point you can configure the desired values for the remaining parameters, and submit the request.
318
313
319
-
320
314
## Next steps
321
315
322
316
For more information about using OAuth 2.0 and API Management, see [Protect a web API backend in Azure API Management using OAuth 2.0 authorization with Azure Active Directory](api-management-howto-protect-backend-with-aad.md).
Copy file name to clipboardExpand all lines: includes/api-management-configure-validate-jwt.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ ms.author: danlep
8
8
9
9
The following example policy, when added to the `<inbound>` policy section, checks the value of the audience claim in an access token obtained from Azure AD that is presented in the Authorization header. It returns an error message if the token is not valid. Configure this policy at a policy scope that's appropriate for your scenario.
10
10
11
-
* In `openid-config`, the `aad-tenant` is the tenant ID in Azure AD. Find this value in the Azure portal, for example, on the **Overview** page of your Azure AD resource. The example shown assumes a single-tenant Azure AD app and a v2 configuration endpoint.
11
+
* In the `openid-config` URL, the `aad-tenant` is the tenant ID in Azure AD. Find this value in the Azure portal, for example, on the **Overview** page of your Azure AD resource. The example shown assumes a single-tenant Azure AD app and a v2 configuration endpoint.
12
12
* The value of the `claim` is the client ID of the backend-app you registered in Azure AD.
13
13
14
14
@@ -24,6 +24,6 @@ The following example policy, when added to the `<inbound>` policy section, chec
24
24
```
25
25
26
26
> [!NOTE]
27
-
> The preceding `openid-config` URL corresponds to the v2 endpoint. For the v1 `openid-config`endpoint, use `https://login.microsoftonline.com/{aad-tenant}/.well-known/openid-configuration`.
27
+
> The preceding `openid-config` URL corresponds to the v2 endpoint. For the v1 `openid-config`endpoint, use `https://login.microsoftonline.com/{aad-tenant}/.well-known/openid-configuration`.
28
28
29
29
For information on how to configure policies, see [Set or edit policies](../articles/api-management/set-edit-policies.md).
0 commit comments