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/policies/use-oauth2-for-authorization.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Sample Azure API management policy - Use OAuth2 for authorization between gateway and backend
3
3
titleSuffix: Azure API Management
4
-
description: Azure API management policy sample - Demonstrates how to use OAuth2 for authorization between the gateway and a backend. It shows how to obtain an access token from AAD and forward it to the backend.
4
+
description: Azure API management policy sample - Demonstrates how to use OAuth2 for authorization between the gateway and a backend. It shows how to obtain an access token from Azure AD and forward it to the backend.
5
5
services: api-management
6
6
documentationcenter: ''
7
7
author: dlepow
@@ -12,17 +12,20 @@ ms.service: api-management
12
12
ms.workload: mobile
13
13
ms.tgt_pltfrm: na
14
14
ms.topic: article
15
-
ms.date: 10/13/2017
15
+
ms.date: 03/14/2023
16
16
ms.author: danlep
17
17
---
18
18
19
19
# Use OAuth2 for authorization between the gateway and a backend
20
+
21
+
This article shows an Azure API management policy sample that demonstrates how to use OAuth2 for authorization between the gateway and a backend. It shows how to obtain an access token from Azure Active Directory and forward it to the backend.
20
22
21
-
This article shows an Azure API management policy sample that demonstrates how to use OAuth2 for authorization between the gateway and a backend. It shows how to obtain an access token from AAD and forward it to the backend.
23
+
* For a more detailed example policy that not only acquires an access token, but also caches and renews it upon expiration, see [this blog](https://techcommunity.microsoft.com/t5/azure-paas-blog/api-management-policy-for-access-token-acquisition-caching-and/ba-p/2191623).
24
+
* API Management [authorizations](../authorizations-overview.md) (preview) can also be used to simplify the process of managing authorization tokens to OAuth 2.0 backend services.
22
25
23
26
To set or edit a policy code, follow the steps described in [Set or edit a policy](../set-edit-policies.md). To see other examples, see [policy samples](../policy-reference.md).
24
27
25
-
The following script uses properties that appear in {{property}}. To learn about properties and how to use them in API Management policies, see [this](../api-management-howto-properties.md) topic.
28
+
The following script uses named values that appear in {{property_name}}. To learn about named values and how to use them in API Management policies, see [this](../api-management-howto-properties.md) topic.
26
29
27
30
## Policy
28
31
@@ -35,4 +38,4 @@ Paste the code into the **inbound** block.
0 commit comments