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-subscriptions.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ author: dlepow
6
6
7
7
ms.service: azure-api-management
8
8
ms.topic: conceptual
9
-
ms.date: 08/02/2023
9
+
ms.date: 09/03/2024
10
10
ms.author: danlep
11
11
ms.custom: engagement-fy23
12
12
---
@@ -133,7 +133,7 @@ After the subscription requirement is disabled, the selected API or APIs can be
133
133
134
134
When API Management receives an API request from a client with a subscription key, it handles the request according to these rules:
135
135
136
-
1. Check if it's a valid key associated with an active subscription, either:
136
+
1. Check first if it's a valid key associated with an active subscription, either:
137
137
138
138
* A subscription scoped to the API
139
139
* A subscription scoped to a product that's assigned to the API
@@ -142,13 +142,15 @@ When API Management receives an API request from a client with a subscription ke
142
142
143
143
If a valid key for an active subscription at an appropriate scope is provided, access is allowed. Policies are applied depending on the configuration of the policy definition at that scope.
144
144
145
+
1. If the key isn't valid but a product exists that includes the API but doesn't require a subscription (an *open* product), ignore the key and handle as an API request without a subscription key (see below).
146
+
145
147
1. Otherwise, access is denied (401 Access denied error).
146
148
147
149
### API request without a subscription key
148
150
149
151
When API Management receives an API request from a client without a subscription key, it handles the request according to these rules:
150
152
151
-
1. Check first for the existence of a product that includes the API but doesn't require a subscription (an *open* product). If the open product exists, handle the request in the context of the APIs, policies, and access rules configured for the product. An API can be associated with at most one open product.
153
+
1. Check first for the existence of a product that includes the API but doesn't require a subscription (an *open* product). If the open product exists, handle the request in the context of the APIs, policies, and access rules configured for the open product. An API can be associated with at most one open product.
152
154
1. If an open product including the API isn't found, check whether the API requires a subscription. If a subscription isn't required, handle the request in the context of that API and operation.
153
155
1. If no configured product or API is found, then access is denied (401 Access denied error).
154
156
@@ -160,16 +162,16 @@ The following table summarizes how the gateway handles API requests with or with
160
162
|All products assigned to API require subscription |API requires subscription |API call with subscription key |API call without subscription key | Typical scenarios |
161
163
|---------|---------|---------|---------|----|
162
164
|✔️ | ✔️ | Access allowed:<br/><br/>• Product-scoped key<br/>• API-scoped key<br/>• All APIs-scoped key<br/>• Service-scoped key<br/><br/>Access denied:<br/><br/>• Other key not scoped to applicable product or API | Access denied | Protected API access using product-scoped or API-scoped subscription |
163
-
|✔️ | ❌ | Access allowed:<br/><br/>• Product-scoped key<br/>• API-scoped key<br/>• All APIs-scoped key<br/>• Service-scoped key<br/><br/>Access denied:<br/><br/>• Other key not scoped to applicable product or API | Access allowed (API context) | • Protected API access with product-scoped subscription<br/><br/>• Anonymous access to API. If anonymous access isn’t intended, configure API-level policies to enforce authentication and authorization. |
165
+
|✔️ | ❌ | Access allowed:<br/><br/>• Product-scoped key<br/>• API-scoped key<br/>• All APIs-scoped key<br/>• Service-scoped key<br/>• Other key not scoped to applicable product or API | Access allowed (API context) | • Protected API access with product-scoped subscription<br/><br/>• Anonymous access to API. If anonymous access isn’t intended, configure API-level policies to enforce authentication and authorization. |
164
166
|❌<sup>1</sup> | ✔️ | Access allowed:<br/><br/>• Product-scoped key<br/>• API-scoped key<br/>• All APIs-scoped key<br/>• Service-scoped key<br/><br/>Access denied:<br/><br/>• Other key not scoped to applicable product or API | Access allowed (open product context) | • Protected API access with API-scoped subscription<br/><br/>• Anonymous access to API. If anonymous access isn’t intended, configure with product policies to enforce authentication and authorization |
165
-
|❌<sup>1</sup> | ❌ | Access allowed:<br/><br/>• Product-scoped key<br/>• API-scoped key<br/>• All APIs-scoped key<br/>• Service-scoped key<br/><br/>Access denied:<br/><br/>• Other key not scoped to applicable product or API | Access allowed (open product context) | Anonymous access to API. If anonymous access isn’t intended, configure with product policies to enforce authentication and authorization |
167
+
|❌<sup>1</sup> | ❌ | Access allowed:<br/><br/>• Product-scoped key<br/>• API-scoped key<br/>• All APIs-scoped key<br/>• Service-scoped key<br/>• Other key not scoped to applicable product or API | Access allowed (open product context) | Anonymous access to API. If anonymous access isn’t intended, configure with product policies to enforce authentication and authorization |
166
168
167
169
<sup>1</sup> An open product exists that's associated with the API.
168
170
169
171
### Considerations
170
172
171
173
- API access in a product context is the same, whether the product is published or not. Unpublishing the product hides it from the developer portal, but it doesn’t invalidate new or existing subscription keys.
172
-
- Even if a product or API doesn't require a subscription, a valid key from an active subscription that enables access to the product or API can still be used.
174
+
- If an API doesn't require subscription authentication, any API request that includes a subscription key is treated the same as a request without a subscription key. The subscription key is ignored.
173
175
- API access "context" means the policies and access controls that are applied at a particular scope (for example, API or product).
0 commit comments