Skip to content

Commit 203634f

Browse files
committed
Content updates from dlepow
1 parent 3021ec3 commit 203634f

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

articles/api-management/api-management-access-restriction-policies.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ This article provides a reference for API Management access restriction policies
2626
- [Restrict caller IPs](#RestrictCallerIPs) - Filters (allows/denies) calls from specific IP addresses and/or address ranges.
2727
- [Set usage quota by subscription](#SetUsageQuota) - Allows you to enforce a renewable or lifetime call volume and/or bandwidth quota, on a per subscription basis.
2828
- [Set usage quota by key](#SetUsageQuotaByKey) - Allows you to enforce a renewable or lifetime call volume and/or bandwidth quota, on a per key basis.
29-
- [Validate Azure Active Directory Token](#ValidateAAD) - Enforces existence and validity of an Azure Active Directory JWT extracted from either a specified HTTP Header, query parameter, or token value.
30-
- [Validate JWT](#ValidateJWT) - Enforces existence and validity of a JWT extracted from either a specified HTTP header or a specified query parameter.
29+
- [Validate Azure Active Directory token](#ValidateAAD) - Enforces existence and validity of an Azure Active Directory JWT extracted from either a specified HTTP header, query parameter, or token value.
30+
- [Validate JWT](#ValidateJWT) - Enforces existence and validity of a JWT extracted from either a specified HTTP header, query parameter, or token value.
3131
- [Validate client certificate](#validate-client-certificate) - Enforces that a certificate presented by a client to an API Management instance matches specified validation rules and claims.
3232

3333
> [!TIP]
@@ -561,7 +561,7 @@ This policy can be used in the following policy [sections](./api-management-howt
561561

562562
## <a name="ValidateAAD"></a> Validate Azure Active Directory token
563563

564-
The `validate-azure-ad-token` policy enforces the existence and validity of a JSON web token (JWT) that was provided by the Azure Active Directory service. The JWT can be extracted from a specified HTTP header, query parameter, or provided using a policy expression or context variable.
564+
The `validate-azure-ad-token` policy enforces the existence and validity of a JSON web token (JWT) that was provided by the Azure Active Directory service. The JWT can be extracted from a specified HTTP header, query parameter, or value provided using a policy expression or context variable.
565565

566566
### Policy statement
567567

@@ -571,15 +571,15 @@ The `validate-azure-ad-token` policy enforces the existence and validity of a JS
571571
header-name="name of HTTP header containing the token (alternatively, use query-parameter-name or token-value attribute to specify token)"
572572
query-parameter-name="name of query parameter used to pass the token (alternative, use header-name or token-value attribute to specify token)"
573573
token-value="expression returning the token as a string (alternatively, use header-name or query-parameter attribute to specify token)"
574-
failed-validation-httpcode="http status code to return on failure"
574+
failed-validation-httpcode="HTTP status code to return on failure"
575575
failed-validation-error-message="error message to return on failure"
576576
output-token-variable-name="name of a variable to receive a JWT object representing successfully validated token">
577577
<client-application-ids>
578-
<application-id>Client Application ID from Azure Active Directory</application-id>
578+
<application-id>Client application ID from Azure Active Directory</application-id>
579579
<!-- If there are multiple client application IDs, then add additional application-id elements -->
580580
</client-application-ids>
581581
<backend-application-ids>
582-
<application-id>Backend Application ID from Azure Active Directory</application-id>
582+
<application-id>Backend application ID from Azure Active Directory</application-id>
583583
<!-- If there are multiple backend application IDs, then add additional application-id elements -->
584584
</backend-application-ids>
585585
<audiences>
@@ -589,7 +589,7 @@ The `validate-azure-ad-token` policy enforces the existence and validity of a JS
589589
<required-claims>
590590
<claim name="name of the claim as it appears in the token" match="all|any" separator="separator character in a multi-valued claim">
591591
<value>claim value as it is expected to appear in the token</value>
592-
<!-- if there is more than one allowed values, then add additional value elements -->
592+
<!-- if there is more than one allowed value, then add additional value elements -->
593593
</claim>
594594
<!-- if there are multiple possible allowed values, then add additional value elements -->
595595
</required-claims>
@@ -600,7 +600,7 @@ The `validate-azure-ad-token` policy enforces the existence and validity of a JS
600600

601601
#### Simple token validation
602602

603-
The following policy is the minimal form of the `validate-azure-ad-token` policy. It expects the JWT to be provided in the `Authorization` header using the `Bearer` scheme.
603+
The following policy is the minimal form of the `validate-azure-ad-token` policy. It expects the JWT to be provided in the `Authorization` header using the `Bearer` scheme. In this example, the Azure AD tenant ID and client application ID are provided using named values.
604604

605605
```xml
606606
<validate-azure-ad-token tenant-id="{{aad-tenant-id}}">
@@ -612,7 +612,9 @@ The following policy is the minimal form of the `validate-azure-ad-token` policy
612612

613613
#### Validate that audience and claim are correct
614614

615-
The following policy checks that the audience is the hostname of the API Management instance and that the `ctry` claim is `US`. The decoded JWT is provided in the `jwt` variable after validation. For more details on optional claims, read [Provide optional claims to your app](/azure/active-directory/develop/active-directory-optional-claims).
615+
The following policy checks that the audience is the hostname of the API Management instance and that the `ctry` claim is `US`. The hostname is provided using a policy expression, and the Azure AD tenant ID and client application ID are provided using named values. The decoded JWT is provided in the `jwt` variable after validation.
616+
617+
For more details on optional claims, read [Provide optional claims to your app](/azure/active-directory/develop/active-directory-optional-claims).
616618

617619
```xml
618620
<validate-azure-ad-token tenant-id="{{aad-tenant-id}}" output-token-variable-name="jwt">
@@ -645,7 +647,7 @@ The following policy checks that the audience is the hostname of the API Managem
645647
| Name | Description | Required | Default |
646648
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
647649
| failed-validation-error-message | Error message to return in the HTTP response body if the JWT doesn't pass validation. This message must have any special characters properly escaped. | No | Default error message depends on validation issue, for example "JWT not present." |
648-
| failed-validation-httpcode | HTTP Status code to return if the JWT doesn't pass validation. | No | 401 |
650+
| failed-validation-httpcode | HTTP status code to return if the JWT doesn't pass validation. | No | 401 |
649651
| header-name | The name of the HTTP header holding the token. | One of `header-name`, `query-parameter-name` or `token-value` must be specified. | N/A |
650652
| match | The `match` attribute on the `claim` element specifies whether every claim value in the policy must be present in the token for validation to succeed. Possible values are:<br /><br /> - `all` - every claim value in the policy must be present in the token for validation to succeed.<br /><br /> - `any` - at least one claim value must be present in the token for validation to succeed. | No | all |
651653
| output-token-variable-name | String. Name of context variable that will receive token value as an object of type [`Jwt`](api-management-policy-expressions.md) upon successful token validation | No | N/A |

articles/api-management/api-management-policies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ More information about policies:
3030
- [Set usage quota by subscription](api-management-access-restriction-policies.md#SetUsageQuota) - Allows you to enforce a renewable or lifetime call volume and/or bandwidth quota, on a per subscription basis.
3131
- [Set usage quota by key](api-management-access-restriction-policies.md#SetUsageQuotaByKey) - Allows you to enforce a renewable or lifetime call volume and/or bandwidth quota, on a per key basis.
3232
- [Validate Azure Active Directory Token](api-management-access-restriction-policies.md#ValidateAAD) - Enforces existence and validity of an Azure Active Directory JWT extracted from either a specified HTTP Header, query parameter, or token value.
33-
- [Validate JWT](api-management-access-restriction-policies.md#ValidateJWT) - Enforces existence and validity of a JWT extracted from either a specified HTTP Header or a specified query parameter.
33+
- [Validate JWT](api-management-access-restriction-policies.md#ValidateJWT) - Enforces existence and validity of a JWT extracted from either a specified HTTP Header, query parameter, or token value.
3434
- [Validate client certificate](api-management-access-restriction-policies.md#validate-client-certificate) - Enforces that a certificate presented by a client to an API Management instance matches specified validation rules and claims.
3535

3636
## Advanced policies

0 commit comments

Comments
 (0)