What API Gateway Checks in a JWT - REST and HTTP API JWT Authorizers, Cognito Authorizers, and Lambda Authorizers
First Published:
Last Updated:
For developers considering a migration, two key questions remain: How much of the validation previously handled by Lambda authorizers can be delegated to the new authorizers? And, even after delegation, what must the integration's code keep checking? This article presents a comparison of four types of API Gateway authorizers: JWT authorizers for REST APIs, JWT authorizers for HTTP APIs, Amazon Cognito user pool authorizers for REST APIs, and Lambda authorizers. The comparison covers the following areas: signature and algorithm verification,
kid, iss, aud, and client_id, timestamps, scope, additional claims, revocation, key caching, token retrieval location, result caching, and failure responses.The conclusion comes first. The REST API's JWT authorizer, following the seven steps outlined in the developer guide, verifies the issuer, signature, audience, time, additional claims, and scope. This process does not include checks for revocation or the
sub claim. The rules for additional claims are limited to comparing a single string value against a single expected value. Array-based claims do not match the rules and receive a 403 error. Tokens lacking the required scope also receive a 403 error. In the same situation, the REST API's Cognito authorizer returns a 401 error. The configuration setting authorizerResultTtlInSeconds for caching results is not supported by the JWT authorizer. Configuration updates are performed as a complete replacement. There are discrepancies between the developer guide and a related article published on the AWS Compute Blog on the same day, particularly regarding the order of validation, key caching, and supported Regions. This article prioritizes the information presented in the developer guide, and any information unique to the blog will be marked accordingly.This article was written after reviewing the documentation on November 27, 2026 (Japan Standard Time). Nothing in this article was tested on AWS. Pricing information is not included. This article was written before AWS re:Invent 2026 (November 30 – December 4, 2026) and does not include any information that will be presented at that event.
Related articles on this site:
- JWT Signing Algorithms on AWS Endpoints - What IAM, Application Load Balancer, API Gateway, AppSync, Cognito, and IAM Identity Center Accept, and What They Check Besides the Signature
- Amazon API Gateway Decision Guide - REST, HTTP, and WebSocket APIs and Integration Patterns
- Which alg a JWT Library Accepts When You Do Not Say - Algorithm Allowlists, Key Binding, Unknown Keys in a JWKS, and RFC 8725
- When sub Changes on Every Sign-In - Ephemeral Subject Identifiers and the AWS Receivers That Key on It
- What Stays Valid After You Revoke on AWS - Role Sessions, Presigned URLs, Portal Sessions, Tokens, and Open Connections
- Amazon Cognito Multi-Region Replication - What Only the Primary Accepts, Which Issuer Your Tokens Carry, and What Validators Must Assume
- AWS History and Timeline regarding Amazon API Gateway - Overview, Functions, Features, Summary of Updates, and Introduction
Table of Contents
- 1. Scope and Assumptions
- 2. Four Types of Authorizers and the Tokens They Accept
- 3. REST API JWT Authorizer: 7 Steps and 401/403 Responses
- 4. Comparison by Item
- 5. What Can Be Verified by Additional Claim Rules
- 6. What Changes When You Replace a Lambda or Cognito Authorizer
- 7. What Stays with the Integration
- 8. Frequently Asked Questions about JWT Validation in API Gateway
- 9. Summary
- 10. References
1. Scope and Assumptions
This chapter first defines the intended audience, the scope of this article, the materials read, and the labels used. The conclusions are as follows:- The JWT authorizer for the REST API validates tokens according to a seven-step process, as outlined in the developer guide. The seven steps include no check for revocation or the
subclaim (Chapter 3). - Even for the same item, the four types of authorizers check it differently. The JWT authorizer for the HTTP API only accepts RSA signatures, while the JWT authorizer for the REST API also supports elliptic curve signatures. The REST API JWT authorizer returns a 403 error for missing scopes, whereas the Cognito authorizer returns a 401 error (Chapter 4).
- The rules for additional claims only compare a single string value against a single expected value. Handling array-based claims and values that vary per method is left to the integration's code or a Lambda authorizer (Chapter 5).
- A replacement means a full replacement of the configuration, the loss of result caching, fields to remove during conversion, and a change of each method's authorization type followed by a deployment (Chapter 6).
- Revocation, the binding of the
subclaim, tenant-specific decisions, and the handling of nested claims stay with the integration's code (Chapter 7).
1.1 Intended Audience
This article is intended for the following audience:- Developers working on APIs that receive tokens from external OIDC or OAuth 2.0 IdPs, including IdPs other than Cognito.
- Security engineers who are evaluating whether they can replace their Lambda authorizers with native JWT authorizers.
1.2 Scope: What This Article Covers, and What It Does Not
This article will address the following topics:- Which items in a JWT each of the four API Gateway authorizer types checks, and which it does not.
- The order of validation for JWT authorizers in REST APIs, and the responses returned when validation fails at each step.
- What additional claim rules can and cannot express.
- What changes when you replace a Lambda or Cognito authorizer.
- What is left to the integration.
- Discrepancies between the developer guide pages and the Compute Blog post.
This article will not cover:
- General principles of signature algorithms, and the behavior of JWT libraries. These topics are covered in the articles "JWT Signing Algorithms on AWS Endpoints" and "Which alg a JWT Library Accepts When You Do Not Say" on this site.
- Choosing between REST APIs and HTTP APIs. This is covered in the "Amazon API Gateway Decision Guide" on this site.
- Cognito's multi-region replication and issuer formats. This is covered in the "Amazon Cognito Multi-Region Replication" article on this site.
- Explanations of the mechanisms behind OAuth 2.0 and OIDC.
- IAM authorization (
AWS_IAM) and mutual TLS. - Pricing.
1.3 Materials Reviewed
This article is based on the following materials:- Six pages from the API Gateway Developer Guide regarding the REST API JWT authorizer: the overview page, the create page, the page on attaching it to methods, the update page, the page on passing claims to the integration, and the page on signing keys and troubleshooting.
- Also from the same guide: the HTTP API JWT authorizer page and its troubleshooting page, the Cognito authorizer pages, the Lambda authorizer pages, and the quotas pages.
- The following pages from the API Gateway API Reference:
CreateAuthorizer,JwtConfigurationInput,JwtIssuerInput,JwtAdditionalClaim, andPutMethod, as well as the Authorizer page of the HTTP API reference. - The following from AWS CloudFormation:
AWS::ApiGateway::Authorizer. - An announcement from "What's New" dated November 17, 2026, and a post on the AWS Compute Blog, also dated November 17, 2026, titled "Securing REST APIs with JWT authorizers in Amazon API Gateway."
The "What's New" announcement is published with the same content on two different URLs. This article uses a single date, November 17, 2026.
1.4 Labels for Each Statement
There are instances where the documentation pages and the blog describe the same functionality differently. This article attaches one of the following four labels to each statement:- Stated on the page: The statement is in the developer guide, the API Reference, or the What's New post.
- Blog only: The statement is only in the Compute Blog post and was not found on the developer guide pages.
- Not stated on the page: No statement about the item was found on the pages this article read.
- Inference: This article's interpretation, derived from combining descriptions found on multiple pages.
The absence of a statement does not mean that the behavior does not exist. This article does not count an item with no statement as either checked or not checked.
2. Four Types of Authorizers and the Tokens They Accept
This chapter outlines the four types of authorizers, specifying what tokens they receive, where they verify those tokens, and what they pass to the integration.2.1 Four Types of Authorizers
| Authorizer | Type Value | Accepted Credentials | Trust Configuration | Who Checks |
|---|---|---|---|---|
| REST API JWT authorizer | JWT | JWT in a single header | Issuer: 1 to 10, Audience: 1 to 100 per issuer | API Gateway |
| HTTP API JWT authorizer | JWT | JWT in a single header or query string | Issuer: one, Audience: up to 50 | API Gateway |
| REST API Cognito authorizer | COGNITO_USER_POOLS | Cognito ID token or access token in a header | User pool ARN | API Gateway |
| Lambda authorizer | TOKEN or REQUEST | TOKEN: in a single header; REQUEST: in headers, query strings, stage variables, and context variables | Your code | Your Lambda function |
The Quotas page describes the limits for the REST API JWT authorizer (stated on the page). The maximum number of issuers is 10 per authorizer, the maximum number of audiences is 100 per issuer, and up to 10 additional claims per issuer. The maximum configuration size is 350 KB. These limits cannot be increased. The maximum audience limit of 50 for HTTP API JWT authorizers is also described on the HTTP API Quotas page (stated on the page).
The REST API Quotas page includes a row specifying the number of authorizers per API. This row is named "Authorizers per API (AWS Lambda and Amazon Cognito)" and has a limit of 10. Whether JWT authorizers count toward this limit of 10 is not stated on the page.
The REST API JWT authorizer is available for three types of REST APIs: Regional, edge-optimized, and private (stated on the page). For supported Regions, the "What's New" announcement names all commercial Regions and the AWS GovCloud (US) Regions. The Compute Blog post adds the China Regions to this list (Blog only).
2.2 The Page's Table for Choosing an Authorizer
The page providing an overview of the REST API's JWT authorizer lists the distinctions between three different types of authorizers. The row detailing the Lambda authorizer is as follows:Use a Lambda authorizer when authorization needs custom logic or credentials that aren't JWTs.
The row detailing the Cognito authorizer is as follows:
Use an Amazon Cognito user pool authorizer when your users are in Amazon Cognito user pools and you want to accept tokens from any app client in those pools without listing each client ID.
The three rows of this table do not say that the new authorizer replaces both the Lambda authorizer and the Cognito authorizer. Custom logic and credentials that are not JWTs stay with the Lambda authorizer. Accepting tokens without listing app client IDs stays with the Cognito authorizer.
Figure 1 illustrates how the four different types of authorizers verify tokens and what they pass to the integration.

3. REST API JWT Authorizer: 7 Steps and 401/403 Responses
This chapter details the sequence of steps that the REST API JWT authorizer follows to validate a single request, and describes the responses it returns on failure, as outlined in the developer guide.3.1 Developer Guide: 7 Steps
The overview page outlines a validation process in 7 steps.API Gateway uses the following steps to authorize a request to a method that uses a JWT authorizer:
1. API Gateway reads the token from the request header that you configure as the identity source.
1. API Gateway finds the issuer configuration whose issuer matches the token's iss claim. API Gateway rejects a token from an issuer that you did not configure.
1. API Gateway verifies the token signature against the issuer's public signing keys. API Gateway finds those keys through the issuer's OIDC discovery document.
1. API Gateway checks the aud claim against the audiences that you configure. For an Amazon Cognito access token, API Gateway checks the client_id claim instead. API Gateway also checks the exp, nbf, and iat claims against the current time. API Gateway allows 60 seconds of clock skew when it checks these time claims.
1. API Gateway evaluates any additional claim rules that you configure for the issuer.
1. If the method requires authorization scopes, API Gateway checks that the token's scope or scp claim contains at least one of them.
1. API Gateway makes the token's claims available to your integration in $context.authorizer.claims.
The following table restates what each step checks, in this article's words.
| Step | Verification Item | Notes from this Article |
|---|---|---|
| 1 | Read the token from the identity source header. | One header only. Query strings are not supported (see API Reference). |
| 2 | Find the issuer configuration that matches the iss value. | Reject tokens from issuers that are not configured. Ensure a complete match, including the trailing slash (see the create page). |
| 3 | Verify the signature using the issuer's public key. | Locate the key from the OIDC discovery document. |
| 4 | Verify aud (client_id for a Cognito access token), exp, nbf, and iat. | Allows 60 seconds of clock skew for the three time claims. |
| 5 | Verify any additional claim rules configured for the issuer. | See Chapter 5. |
| 6 | Check if at least one of the scopes required by the method is present in either the scope or scp claim. | Only when the method requires scopes. |
| 7 | Pass the claims to the integration in $context.authorizer.claims. | See Chapter 7. |
None of the seven steps checks revocation. No step checks the
sub claim either.3.2 Response on Failure
The same page describes the response in case of failure as follows:If any step fails, API Gateway rejects the request. A missing, malformed, expired, or untrusted token receives a 401 Unauthorized response. A valid token that lacks a required scope or fails an additional claim rule receives a 403 Forbidden response. API Gateway does not pass a rejected request to the integration.
The response will take one of two forms. A 401 error is returned when the token itself is unacceptable. A 403 error is returned when the token is valid, but does not meet the required scope or additional claim rules. Rejected requests do not reach the integration.
Regarding signature algorithms, the same page states:
A JWT authorizer supports the RS256, RS384, RS512, ES256, ES384, and ES512 signing algorithms. You set the algorithms that you allow in the defaultAlgorithms field, which is required. API Gateway rejects a token that is signed with an HMAC algorithm, such as HS256, and a token that uses alg: none.
defaultAlgorithms applies to all issuers (see API reference). There is no field in JwtIssuerInput that allows specifying different algorithms for each issuer.3.3 How the Order Differs in the Compute Blog Post
The Compute Blog post also describes the flow of a single request in seven bullet points. The five that describe checks are as follows.API Gateway matches the token’s iss claim to a configured issuer and rejects a token from an unknown issuer before any network call.
API Gateway checks that the token’s signing algorithm is one you configured, then validates the signature against the issuer’s public keys, which it locates through OIDC discovery and caches.
API Gateway checks the audience and the expiry and not-before times.
If the method requires authorization scopes, you must use an access token that carries at least one of them in its scope or scp claim.
API Gateway checks any additional claim rules you configured for that issuer.
In the verification order and the time claims, the page and the blog's bullet points differ in two places.
- The page places the rules for additional claims (step 5) before the scope (step 6). The blog, however, places the scope first, followed by the rules for additional claims.
- The page's step 4 lists
iat. The blog's bullet points list only the audience, the expiry, and the not-before time.
In addition, the blog's bullet points describe checking, before the signature, that the signing algorithm is one you configured, and rejecting a token from an unknown issuer before any network call (Blog only). The page describes the accepted algorithms in a section outside the seven steps.
Even with the order reversed, a failure of either check receives a 403 error. This article treats the page's order as authoritative. The blog post also says that API Gateway stops processing at the first failed check (Blog only).
3.4 Differences Between the Pages and the Blog Post
The following table summarizes where the pages and the blog post differ, and what only the blog post states.| Item | Developer Guide and What's New | Compute Blog Post | How This Article Treats It |
|---|---|---|---|
| Validation Order | Additional claim rules, then scope. | Scope, then additional claim rules. | The page is authoritative. |
| Key Caching | Up to 1 hour, best effort. | Approximately 60 minutes. If the key endpoint is unreachable, API Gateway keeps using the last key set for up to 1 hour. | The page is authoritative. The handling when the key endpoint is unreachable is Blog only. |
| Key Retrieval Failure | Not stated on the page. | If the key endpoint is unreachable and no cached keys are available, API Gateway returns a 5xx response. | Blog only. |
| Supported Regions | Commercial Regions and GovCloud (US). | Adds the China Regions to this list. | Blog only. |
kid | Not stated on the REST API pages. The HTTP API page requires it. | Requires the kid in the token header. | Blog only. |
| Cognito Token Types | Not stated on the REST API JWT authorizer pages. | Methods with scopes accept only access tokens; methods without scopes accept only ID tokens. | Blog only. |
| Rejection Details | Not stated on the REST API pages. | A WWW-Authenticate header that follows RFC 6750 carries details such as the failed check or the scopes the method accepts. | Blog only. |
| Test Invocation | Not stated on the page. | test-invoke-authorizer does not check the method's scopes and accepts Cognito ID tokens. | Blog only. |
| Convertible Sources | TOKEN authorizer and Cognito authorizer. | Lambda authorizer and Cognito authorizer. | The page is authoritative. For a REQUEST authorizer, not stated on the page. |
| Revocation | Tokens are valid until the exp time. | The JWT authorizer does not check revocation. | The two agree. |
4. Comparison by Item
This chapter lines up, item by item in a JWT, how the four authorizers check it. Each cell carries a label from Section 1.4. A cell without a label is stated on the page.4.1 Comparison Table
| Item | REST API JWT | HTTP API JWT | REST API Cognito | Lambda |
|---|---|---|---|---|
| Token Reading Location | Single header. Query strings cannot be used. | Single header or query string. | Header. | TOKEN: one header. REQUEST: several locations. |
| Signature and Algorithm | Choose from RS256, RS384, RS512, ES256, ES384, ES512. HMAC and alg: none are rejected. | Only RSA algorithms. | Not stated on the page. | Your code. |
kid | Not stated on the page. The blog post says it is required. | Requires a kid that matches the signing key. | Not stated on the page. | Your code. |
iss | Must exactly match one of the configured issuers, including the trailing slash. | Must match the one configured issuer. | Specifies the user pool using the ARN. How iss is compared is not stated on the page. | Your code. |
aud and client_id | Compares with the audience for each issuer. For Cognito access tokens, compares with client_id. | Compares with the audience. Only compares with client_id if aud is not present. | Allows configuring regular expression matching for the aud in the ID token. Configuration is optional. | Your code. |
| Time | Compares exp, nbf, and iat, allowing 60 seconds of clock skew. | Compares exp, nbf, and iat against the current UTC time. Clock skew tolerance is not stated on the page. | Not stated on the page. | Your code. |
| Scope | Requires one or more of the method's scopes in scope or scp. Missing scopes result in a 403 error. | Requires one or more of the route's scopes in scope or scp. The response for missing scopes is not stated on the page. | If the method has scopes, it requires an access token. Mismatches result in a 401 error. | Your code. |
| Additional Claims | Up to 10 rules per issuer. Mismatches result in a 403 error. | No setting. | No setting. | Your code. |
| Revocation | Not checked (inference). Tokens are valid until the exp time. | Not in the list of evaluated claims. | Not stated on the page. | Your code. |
sub | Not in the seven steps. | Not in the list of evaluated claims. | Not stated on the page. | Your code. |
| Key Caching | Maximum 1 hour. When a token signed with an unknown key arrives, API Gateway retrieves the key set again. | Maximum 2 hours. | Not stated on the page. | Your code. |
| Result Caching | The field exists but is not supported for JWT authorizers. | The field exists but only Lambda authorizers use it. | Not stated on the page. | Default: 300 seconds, maximum: 3600 seconds. 0 disables caching. |
| Failure Response | 401 and 403. | 401 with a www-authenticate header. | Scope mismatches result in a 401 error. | 401 and 403. |
| Passed to Integration | Passes claims as JSON values. | Passes claims. | Passes claims. | principalId and context. context values become strings. |
Figure 2 uses color to differentiate the items in this table. Green indicates items checked by API Gateway, red indicates items that are not checked or have no setting, and blue indicates items not stated on the page.

4.2 Algorithms and Keys
The REST API's JWT authorizer supports three RSA algorithms and three elliptic curve algorithms. The HTTP API page states that it supports only RSA.Currently, only RSA-based algorithms are supported.
Even if the token is issued by the same IdP, the REST API's JWT authorizer will accept tokens signed with ES256, while the HTTP API's JWT authorizer will not (inference). For the general discussion of algorithms, see this site's "JWT Signing Algorithms on AWS Endpoints."
The key caching duration also differs. The page detailing the signing keys for the REST API states:
API Gateway caches each issuer's signing keys for up to 1 hour on a best-effort basis.
The HTTP API JWT authorizer page states:
API Gateway caches the public key for up to two hours on a best-effort basis.
The process for rotating keys, as described on the REST API page, involves adding new keys to the key set before beginning to sign tokens with them. Keep the old key published until the tokens it signed have expired. When API Gateway receives a token signed with a key it has not seen, it retrieves the key set again (stated on the page).
4.3 Audience and client_id
Cognito access tokens identify the app client in client_id. The Cognito developer guide states that the aud claim in an access token is only included when the application requests a resource binding. The page on REST API JWT authorizers states that it compares the client_id when using Cognito access tokens. The page on HTTP APIs states the condition as follows:API Gateway validates client_id only if aud is not present. When both aud and client_id are present, API Gateway evaluates aud.
The condition on the page for REST API JWT authorizers is that the token must be a Cognito access token. The condition on the page for HTTP APIs is that the
aud claim must be absent. The page does not specify whether the REST API JWT authorizer compares the aud or client_id for a Cognito access token that carries aud because of a resource binding. Similarly, the page does not specify whether the REST API JWT authorizer compares the client_id when it receives tokens from identity providers (IdPs) other than Cognito that do not include the aud claim. In the API Reference, the description of audiences in JwtIssuerInput says that the token's aud claim must contain at least one of the values.The way the Cognito authorizer validates the audience is different from the other three authorizers. When you enter a regular expression in the token validation field, it compares the
aud claim of the ID token. The page states that if you send an access token with this configuration, it will be rejected because it does not include the aud claim (stated on the page). The table in Section 2.2 states that the Cognito authorizer can accept tokens without listing app client IDs.4.4 Scope and Response
The REST API's JWT authorizer returns a 403 error when a scope is missing. The page on attaching the authorizer to methods states:A valid token that carries none of the method's scopes receives a 403 Forbidden response.
The REST API's Cognito authorizer returns a 401 error when there is a scope mismatch. The Cognito authorizer page states:
At runtime, the method call succeeds if any scope that's specified on the method in this step matches a scope that's claimed in the incoming token. Otherwise, the call fails with a 401 Unauthorized response.
Within the same REST API, the response for a missing scope varies depending on the type of authorizer. If the client is designed to reacquire a token upon receiving a 401 error, it may repeatedly attempt to reacquire the token even when the issue is due to a missing scope (inference). The response for a missing scope from the HTTP API's JWT authorizer is not stated on the page.
Cognito uses scope names in the format
{resource-server}/{scope}. When a REST API's JWT authorizer trusts both Cognito and other IdPs, the method should list both formats of scope (stated on the page). The method will allow access if the token contains any one of the listed scopes.4.5 Result Caching
Lambda authorizers can cache results. The API reference describesauthorizerResultTtlInSeconds as follows:The TTL in seconds of cached authorizer results. If it equals 0, authorization caching is disabled. If it is greater than 0, API Gateway will cache authorizer responses. If this field is not set, the default value is 300. The maximum value is 3600, or 1 hour. This property is not supported for JWT authorizers.
This field is not supported by JWT authorizers. The CloudFormation description for
AuthorizerResultTtlInSeconds also ends with the same sentence. The "What's New" announcement states that API Gateway verifies the signature, issuer, audience, expiration, and claims for each request. The API reference for HTTP APIs also specifies that this field with the same name is used exclusively with Lambda authorizers.5. What Can Be Verified by Additional Claim Rules
This chapter outlines what the additional claim rules for the REST API's JWT authorizer can and cannot verify. These rules are not available in the HTTP API or Cognito authorizers.5.1 Rule Format
The create page describes the rules as follows:You can configure up to 10 claim rules for each issuer. Each rule names a claim and sets whether the claim is required and which values API Gateway accepts. A claim name must be unique within the issuer, and it cannot be iss, aud, exp, nbf, iat, scope, or scp. A claim rule uses the SINGLE_STRING format and accepts at most one expected value, which you set as the only item in expectedValues. API Gateway matches the value exactly, and the match is case-sensitive. If expectedValues contains more than one value, API Gateway returns a 400 error. A claim rule matches only a claim whose value in the token is a single string. If the token's claim is an array, such as "groups": ["admins", "users"], the token fails the rule and receives a 403 response.
The rule behaves in four different ways, depending on the
required setting and the expected value (stated on the page).required | Expected Value | Behavior |
|---|---|---|
| true | None | Rejects tokens without the claim. Does not validate the value. |
| true | Present | Rejects tokens without the claim and tokens with an incorrect value. |
| false | Present | Validates the value only when the claim is present. Allows tokens without the claim to pass. |
| false | None | Performs no validation. |
The default value for
required is false (see API Reference). If you specify only the expected value and omit required, tokens without that claim will be allowed. If you want to validate the value, set required to true.Rules are defined per issuer. All methods using the same authorizer are subject to the same rule. An example of a configuration is shown below. It trusts two issuers, and requires tokens from the first issuer to have a
department claim with a value of eng.{
"issuers": [
{
"issuer": "https://identity.example.com",
"audiences": ["api://orders"],
"additionalClaims": [
{
"claimName": "department",
"format": "SINGLE_STRING",
"required": true,
"expectedValues": ["eng"]
}
]
},
{
"issuer": "https://cognito-idp.us-east-1.amazonaws.com/us-east-1_EXAMPLE",
"audiences": ["exampleappclientid"]
}
],
"defaultAlgorithms": ["RS256"]
}
5.2 What Rules Can and Cannot Express
Rules can express the following:- That a single-string claim is present.
- That a single-string claim has one specific value.
- That the condition is the same across all methods that use the authorizer.
Rules cannot express the following:
- Array claims. Lists of groups or roles, for example, do not match the rules and receive a 403 error.
- Any one of two or more values. If you specify two expected values, the configuration will be rejected with a 400 error.
- Values that differ from method to method.
- Numeric or Boolean claims. The only supported rule format is
SINGLE_STRING. - Values within nested claims.
- Comparisons with the request content, such as comparing a tenant ID with the request path.
Numbers, Booleans, nested claims, and comparisons with the request are this article's reading of the rule format and the page's description (inference). The signing keys page names where such checks go:
API Gateway reads method scopes only from the token's scope or scp claim. If your identity provider carries permissions in a different claim, and every method that uses the authorizer requires the same single string value, add a claim rule to the issuer. For more information, see Additional claims.
If different methods require different values, or the claim is an array, use a Lambda authorizer.
If the IdP carries permissions in a claim other than
scope, and that claim is an array, the REST API's JWT authorizer alone cannot check it. That check stays with a Lambda authorizer or the integration's code.6. What Changes When You Replace a Lambda or Cognito Authorizer
This chapter outlines what changes, and what you must do, when you replace an existing authorizer with a REST API JWT authorizer.6.1 Configuration Updates: Full Replacement
The update page indicates that configuration updates involve a complete replacement of the existing settings.You update a JWT authorizer by replacing its whole configuration. API Gateway accepts a single replace operation on the /jwtConfiguration path, with the complete configuration as the value. API Gateway keeps nothing from the previous configuration, so any issuer or claim rule that you leave out is removed. API Gateway runs OIDC discovery again for every issuer on each update.
Even to add a single issuer, read the current configuration, add the new issuer, and send the entire configuration. Any issuers and rules not included in what you send will be removed. Before sending the update, remove the
jwksUri returned by get-authorizer from each issuer. Failure to do so will result in the update being rejected with a 400 error (stated on the page). With each update, API Gateway runs OIDC discovery again for all issuers. If it fails to reach the discovery document for even one issuer, creation or updates will fail (see the troubleshooting table).When migrating an IdP, add the new issuer alongside the old issuer. Once the clients have fully migrated, remove the old issuer (stated on the page).
6.2 Converting an Existing Authorizer
The update page names what you can convert as follows:You can convert a TOKEN authorizer or an Amazon Cognito user pool authorizer to a JWT authorizer.
A conversion sends a replace operation that sets
/type to JWT and a replace operation on /jwtConfiguration, in a single request. A conversion requires you to remove five fields: authorizerUri, authorizerCredentials, providerARNs, identityValidationExpression, and authorizerResultTtlInSeconds. If any of these fields contain a value, the request will return a 400 error (stated on the page). The type cannot be changed through the console.Whether a
REQUEST authorizer can be converted is not stated on the page. The Compute Blog post names Lambda authorizers and Cognito authorizers as what you can convert (Blog only).After the conversion, change the authorization type for each method that uses the authorizer to
JWT and then deploy the API. Changes to the authorizer and changes to the methods do not take effect until the API is deployed (stated on the page). The description for authorizerId in the API reference for PutMethod still states that the supported types are CUSTOM or COGNITO_USER_POOLS. The description for authorizationType includes JWT.6.3 What You Lose When Moving from a Lambda Authorizer
| What was possible with the Lambda authorizer | Handling in the REST API's JWT authorizer |
|---|---|
| Result caching (default 300 seconds) | Not supported. API Gateway checks every request. |
| Handling array claims and making decisions based on different values for each method | Rules cannot express it. It stays with a Lambda authorizer or the integration. |
| Non-JWT credentials | Not accepted. |
| Credentials from query strings or stage variables | Not accepted. Only accepts a single header. |
| Revocation checks and token introspection | Not checked (inference). |
Passing values to the integration with context | Claims reach the integration in $context.authorizer.claims. The integration must change how it reads them (inference). |
The Compute Blog post mentions token introspection as a scenario where the Lambda authorizer is suitable (Blog only). If you were checking revocation in a Lambda authorizer, that check is lost when you replace it.
Within a single API, you can mix different types of authorizers for each method (stated on the page). You can keep a Lambda authorizer for methods that require array claims, while migrating the others to the JWT authorizer.
6.4 What Changes When Moving from a Cognito Authorizer
- You need to list audiences. The Cognito authorizer accepted tokens without listing app client IDs. The JWT authorizer's issuer requires one or more audiences. Since API Gateway compares
client_idfor Cognito access tokens, you need to include the app client ID in the audiences (the page does not state how it compares an access token that carriesaudbecause of a resource binding; see Section 4.3). Step 4 on the page describes this comparison, and the Compute Blog post shows the steps for using the ID as the audience. - The response for insufficient scope changes from 401 to 403 (inference from the two pages in Section 4.4).
- When the format of the scope name varies depending on the IdP, include both formats in the method.
- The user pool is specified using the issuer's URL. Cognito's issuer is
https://cognito-idp.{region}.amazonaws.com/{user-pool-id}(stated on the page).
6.5 Private APIs Still Need IdP Documents Reachable from the Public Internet
The overview page states that even for private APIs, the identity provider's discovery document and key set must be reachable from the public internet.The identity provider's OIDC discovery document, which it publishes at /.well-known/openid-configuration, and its key set must be reachable from the public internet, including for private APIs.
The REST API's JWT authorizer does not accept tokens issued by an IdP operating within a closed network (inference). In such cases, the Lambda authorizer stays. The discovery document and key set must also use a certificate issued by a certificate authority that API Gateway supports (create page).
7. What Stays with the Integration
This chapter lists what the integration's code must keep checking, even after you hand token validation to the REST API's JWT authorizer.7.1 Revocation
The signing keys page states:A token remains valid until its exp time, so use short token lifetimes for sensitive operations.
Even if tokens or sessions are revoked in the IdP, the JWT authorizer will continue to accept those tokens until the
exp (expiration) time. Even if a token is revoked with Cognito's RevokeToken, none of the seven steps checks it (inference). To reflect the revocation, either shorten the token's lifetime or check it in the integration. This site's "What Stays Valid After You Revoke on AWS" addresses what remains valid after a revocation.7.2 sub Binding
The seven steps do not check the sub value. If the integration uses sub as a user ID, the integration decides what a sub from each issuer refers to. When multiple issuers are trusted, another issuer might assign the same sub value (inference). It is safer to treat iss and sub as a pair. If the sub value changes with each sign-in, Section 8.2 of this site's "When sub Changes on Every Sign-In" covers it for the HTTP API JWT authorizer.7.3 Tenant and Array Claims
As described in Chapter 5, array claims, values that differ by method, and comparisons with the request content cannot be expressed as rules. Decisions such as comparing tenant IDs with paths, or determining permissions based on a list of roles, stay with the integration or a Lambda authorizer.7.4 Receiving Claims
The page on passing claims to the integration states the following four points (stated on the page):- Each claim has a value that is in JSON format. String values (e.g.,
"42") and numeric values (e.g.,42) are treated as distinct. - Only top-level claims can be accessed directly. To read a nested value, reference the parent claim and parse it.
- For Lambda proxy integrations, the claims are received with their JSON types in
requestContext.authorizer.claims. - HTTP proxy integrations do not automatically forward the authorizer context. Instead, claims should be mapped to the integration request headers.
In the mapping template, avoid enclosing variables in quotes, as the values are already JSON text (stated on the page). Values mapped to headers also arrive as JSON text and should be parsed as JSON in the integration.
7.5 Rejected Requests Do Not Reach the Integration
Rejected requests do not reach the integration. Consequently, the integration's logs will not contain 401 and 403 requests (inference). The signing keys page states that API Gateway records authorizer failures in the stage's execution logs (stated on the page). To identify patterns of rejections, enable stage execution logging.8. Frequently Asked Questions about JWT Validation in API Gateway
Q1. Does the REST API's JWT authorizer fully validate the tokens?
The developer guide specifies that it verifies the issuer, signature, audience orclient_id, exp, nbf, iat, rules for additional claims, and scope. None of the seven steps checks revocation or sub. Array claims do not match the rules for additional claims.Q2. If you have a REST API JWT authorizer, is a Lambda authorizer unnecessary?
There are cases where a Lambda authorizer is still necessary, even if you have a REST API JWT authorizer. Certain scenarios, such as array claims or values that differ by method, handling non-JWT credentials, revocation checks, or using an IdP within a closed network, still require a Lambda authorizer. It is also possible to combine different authorization types for different methods within a single API.Q3. What status code is returned when the scope is insufficient?
The REST API's JWT authorizer returns a 403. The REST API's Cognito authorizer returns a 401. The response from the HTTP API's JWT authorizer when the scope is insufficient is not stated on the page.Q4. Can a single REST API JWT authorizer accept tokens from Cognito and other identity providers?
Yes, a single REST API JWT authorizer can accept tokens from Cognito and other IdPs. You can list up to 10 issuers. Since API Gateway comparesclient_id instead of aud for Cognito access tokens, include the app client ID in the audiences (the page does not state how it compares an access token that carries aud because of a resource binding; see Section 4.3). If the scope name format differs, list both formats on the method.Q5. When adding a new issuer, are the existing settings preserved?
No, they are not. The update replaces the entire configuration; any issuers and rules you do not send will be removed. Read the current settings, removejwksUri, add the new issuer, and then send the entire configuration.Q6. Can you configure the duration for which results are cached?
No. TheauthorizerResultTtlInSeconds setting is not supported for the JWT authorizer. While the REST API JWT authorizer caches keys for a maximum of one hour, tokens are validated on every request.Q7. Can the REST API JWT authorizer be used with private APIs?
Yes, it is possible. However, the IdP's OIDC discovery document and its key set must be reachable from the public internet.Q8. In which Regions is it available?
The "What's New" announcement names all commercial AWS Regions and the AWS GovCloud (US) Regions. The Compute Blog post adds the China Regions. Before using it in the China Regions, check the documentation for those Regions.9. Summary
The REST API's JWT authorizer, with the seven steps in the developer guide, validates the issuer, signature, audience, time, additional claims, and scope. The seven steps do not check revocation or thesub claim. The rules for additional claims only compare a single string to a single value; array-based claims will result in a 403 error. A missing scope also results in a 403 error, which differs from the 401 error returned by the Cognito authorizer.During replacements, caching of results is lost, and configuration updates result in a complete replacement. Checks of array-based claims, values that differ per method, non-JWT credentials, and revocation checks are left to either the Lambda authorizer or the integration. The integration continues to check revocation, the combination of
iss and sub, tenant decisions, and nested claims.The developer guide pages and the Compute Blog post contain discrepancies regarding the order of validation, key caching, and Regions. This article prioritizes the information presented on the developer guide pages, noting any information specific to the blog with a marker. The content of this article is based on materials current as of November 27, 2026 (Japan Standard Time). Descriptions may change due to updates to the developer guide pages. Before relying on it, open the developer guide pages again.
10. References
- Control access to REST APIs using JWT authorizers - Amazon API Gateway
- Create a JWT authorizer for a REST API - Amazon API Gateway
- Attach a JWT authorizer to methods and require scopes - Amazon API Gateway
- Update a JWT authorizer - Amazon API Gateway
- Pass JWT claims to your integration - Amazon API Gateway
- Signing keys and troubleshooting JWT authorizers - Amazon API Gateway
- Control access to HTTP APIs with JWT authorizers in API Gateway - Amazon API Gateway
- Troubleshooting issues with HTTP API JWT authorizers - Amazon API Gateway
- Control access to REST APIs using Amazon Cognito user pools as an authorizer - Amazon API Gateway
- Understanding the access token - Amazon Cognito
- Integrate a REST API with an Amazon Cognito user pool - Amazon API Gateway
- Use API Gateway Lambda authorizers - Amazon API Gateway
- Output from an API Gateway Lambda authorizer - Amazon API Gateway
- Quotas for configuring and running a REST API in API Gateway - Amazon API Gateway
- Quotas for configuring and running an HTTP API in API Gateway - Amazon API Gateway
- CreateAuthorizer - Amazon API Gateway
- JwtConfigurationInput - Amazon API Gateway
- JwtIssuerInput - Amazon API Gateway
- JwtAdditionalClaim - Amazon API Gateway
- PutMethod - Amazon API Gateway
- Authorizer - Amazon API Gateway
- AWS::ApiGateway::Authorizer - AWS CloudFormation
- Amazon API Gateway REST APIs now support JWT authorizers
- Securing REST APIs with JWT authorizers in Amazon API Gateway
- RFC 7519: JSON Web Token (JWT)
- RFC 6750: The OAuth 2.0 Authorization Framework: Bearer Token Usage
- JWT Signing Algorithms on AWS Endpoints - What IAM, Application Load Balancer, API Gateway, AppSync, Cognito, and IAM Identity Center Accept, and What They Check Besides the Signature
- Amazon API Gateway Decision Guide - REST, HTTP, and WebSocket APIs and Integration Patterns
- Which alg a JWT Library Accepts When You Do Not Say - Algorithm Allowlists, Key Binding, Unknown Keys in a JWKS, and RFC 8725
- When sub Changes on Every Sign-In - Ephemeral Subject Identifiers and the AWS Receivers That Key on It
- What Stays Valid After You Revoke on AWS - Role Sessions, Presigned URLs, Portal Sessions, Tokens, and Open Connections
- Amazon Cognito Multi-Region Replication - What Only the Primary Accepts, Which Issuer Your Tokens Carry, and What Validators Must Assume
- AWS History and Timeline regarding Amazon API Gateway - Overview, Functions, Features, Summary of Updates, and Introduction
References:
Tech Blog with curated related content
Written by Hidekazu Konishi