2026/11/17 - Amazon API Gateway - 4 updated api methods
Changes API Gateway now adds support for JWT authorizers on REST APIs.
{'jwtConfiguration': {'defaultAlgorithms': ['RS256 | RS384 | RS512 | ES256 | '
'ES384 | ES512'],
'issuers': [{'additionalClaims': [{'claimName': 'string',
'expectedValues': ['string'],
'format': 'SINGLE_STRING',
'required': 'boolean'}],
'audiences': ['string'],
'issuer': 'string'}]},
'type': {'JWT'}}
Response {'jwtConfiguration': {'defaultAlgorithms': ['RS256 | RS384 | RS512 | ES256 | '
'ES384 | ES512'],
'issuers': [{'additionalClaims': [{'claimName': 'string',
'expectedValues': ['string'],
'format': 'SINGLE_STRING',
'required': 'boolean'}],
'audiences': ['string'],
'issuer': 'string',
'jwksUri': 'string'}]},
'type': {'JWT'}}
Adds a new Authorizer resource to an existing RestApi resource.
See also: AWS API Documentation
Request Syntax
client.create_authorizer(
restApiId='string',
name='string',
type='TOKEN'|'REQUEST'|'COGNITO_USER_POOLS'|'JWT',
providerARNs=[
'string',
],
authType='string',
authorizerUri='string',
authorizerCredentials='string',
identitySource='string',
identityValidationExpression='string',
authorizerResultTtlInSeconds=123,
jwtConfiguration={
'issuers': [
{
'issuer': 'string',
'audiences': [
'string',
],
'additionalClaims': [
{
'claimName': 'string',
'format': 'SINGLE_STRING',
'required': True|False,
'expectedValues': [
'string',
]
},
]
},
],
'defaultAlgorithms': [
'RS256'|'RS384'|'RS512'|'ES256'|'ES384'|'ES512',
]
}
)
string
[REQUIRED]
The string identifier of the associated RestApi.
string
[REQUIRED]
The name of the authorizer.
string
[REQUIRED]
The authorizer type. Valid values are TOKEN for a Lambda function using a single authorization token submitted in a custom header, REQUEST for a Lambda function using incoming request parameters, COGNITO_USER_POOLS for using an Amazon Cognito user pool, and JWT for using a native JWT authorizer with the trusted issuers, audiences, and signing algorithms that you declare.
list
A list of the Amazon Cognito user pool ARNs for the COGNITO_USER_POOLS authorizer. Each element is of this format: arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}. For a TOKEN or REQUEST authorizer, this is not defined. This property is not supported for JWT authorizers.
(string) --
string
Optional customer-defined field, used in OpenAPI imports and exports without functional impact.
string
Specifies the authorizer's Uniform Resource Identifier (URI). For TOKEN or REQUEST authorizers, this must be a well-formed Lambda function URI, for example, arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations. In general, the URI has this form arn:aws:apigateway:{region}:lambda:path/{service_api}, where {region} is the same as the region hosting the Lambda function, path indicates that the remaining substring in the URI should be treated as the path to the resource, including the initial /. For Lambda functions, this is usually of the form /2015-03-31/functions/[FunctionARN]/invocations. This property is not supported for JWT authorizers.
string
Specifies the required credentials as an IAM role for API Gateway to invoke the authorizer. To specify an IAM role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, specify null. This property is not supported for JWT authorizers.
string
The identity source for which authorization is requested. For a TOKEN or COGNITO_USER_POOLS authorizer, this is required and specifies the request header mapping expression for the custom header holding the authorization token submitted by the client. For example, if the token header name is Auth, the header mapping expression is method.request.header.Auth. For the REQUEST authorizer, this is required when authorization caching is enabled. The value is a comma-separated string of one or more mapping expressions of the specified request parameters. For example, if an Auth header, a Name query string parameter are defined as identity sources, this value is method.request.header.Auth, method.request.querystring.Name. These parameters will be used to derive the authorization caching key and to perform runtime validation of the REQUEST authorizer by verifying all of the identity-related request parameters are present, not null and non-empty. Only when this is true does the authorizer invoke the authorizer Lambda function, otherwise, it returns a 401 Unauthorized response without calling the Lambda function. The valid value is a string of comma-separated mapping expressions of the specified request parameters. When the authorization caching is not enabled, this property is optional. For a JWT authorizer, this is required and must be a single request-header mapping expression, method.request.header.<name>, for example, method.request.header.Authorization. Query string parameters are not supported, and there is no default.
string
A validation expression for the incoming identity token. For TOKEN authorizers, this value is a regular expression. For COGNITO_USER_POOLS authorizers, API Gateway will match the aud field of the incoming token from the client against the specified regular expression. It will invoke the authorizer's Lambda function when there is a match. Otherwise, it will return a 401 Unauthorized response without calling the Lambda function. The validation expression does not apply to the REQUEST or JWT authorizer.
integer
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.
dict
The configuration for a JWT authorizer. Required for JWT authorizers.
issuers (list) -- [REQUIRED]
The issuers that the authorizer trusts. Issuer URLs must be unique.
(dict) --
A trusted issuer in the JWT configuration.
issuer (string) -- [REQUIRED]
The OpenID Connect (OIDC) issuer URL. The value must be an absolute https URL that includes a host and has no user information, query, or fragment. It must exactly match the iss claim of the token, and the issuer's OIDC discovery document must name this exact issuer.
audiences (list) -- [REQUIRED]
The audiences that the issuer can issue tokens for. None can be empty. The token's aud claim must contain at least one of these values.
(string) --
additionalClaims (list) --
The additional claim rules for this issuer. Claim names must be unique within the issuer.
(dict) --
An additional claim rule for an issuer.
claimName (string) -- [REQUIRED]
The name of the claim to check. The value cannot be empty and cannot be iss, aud, exp, nbf, iat, scope, or scp.
format (string) -- [REQUIRED]
The format of the claim value. The only valid value is SINGLE_STRING.
required (boolean) --
Specifies whether the claim must be present in the token. Defaults to false. When true, the token must contain the claim.
expectedValues (list) --
The accepted value for the claim. The value cannot be empty. When a value is specified, the claim must match it exactly, and the match is case-sensitive. When no value is specified, the claim only has to be present.
(string) --
defaultAlgorithms (list) -- [REQUIRED]
The signing algorithms that the authorizer accepts, applied to every issuer. Valid values are RS256, RS384, RS512, ES256, ES384, and ES512.
(string) --
A JSON Web Signature (JWS) signing algorithm. Valid values are RS256, RS384, RS512, ES256, ES384, and ES512. HMAC ( HS256, HS384, HS512) and none are not valid values.
dict
Response Syntax
{
'id': 'string',
'name': 'string',
'type': 'TOKEN'|'REQUEST'|'COGNITO_USER_POOLS'|'JWT',
'providerARNs': [
'string',
],
'authType': 'string',
'authorizerUri': 'string',
'authorizerCredentials': 'string',
'identitySource': 'string',
'identityValidationExpression': 'string',
'authorizerResultTtlInSeconds': 123,
'jwtConfiguration': {
'issuers': [
{
'issuer': 'string',
'audiences': [
'string',
],
'additionalClaims': [
{
'claimName': 'string',
'format': 'SINGLE_STRING',
'required': True|False,
'expectedValues': [
'string',
]
},
],
'jwksUri': 'string'
},
],
'defaultAlgorithms': [
'RS256'|'RS384'|'RS512'|'ES256'|'ES384'|'ES512',
]
}
}
Response Structure
(dict) --
Represents an authorization layer for methods. If enabled on a method, API Gateway will activate the authorizer when a client calls the method.
id (string) --
The identifier for the authorizer resource.
name (string) --
The name of the authorizer.
type (string) --
The authorizer type. Valid values are TOKEN for a Lambda function using a single authorization token submitted in a custom header, REQUEST for a Lambda function using incoming request parameters, COGNITO_USER_POOLS for using an Amazon Cognito user pool, and JWT for using a native JWT authorizer with the trusted issuers, audiences, and signing algorithms that you declare.
providerARNs (list) --
A list of the Amazon Cognito user pool ARNs for the COGNITO_USER_POOLS authorizer. Each element is of this format: arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}. For a TOKEN or REQUEST authorizer, this is not defined. This property is not supported for JWT authorizers.
(string) --
authType (string) --
Optional customer-defined field, used in OpenAPI imports and exports without functional impact.
authorizerUri (string) --
Specifies the authorizer's Uniform Resource Identifier (URI). For TOKEN or REQUEST authorizers, this must be a well-formed Lambda function URI, for example, arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations. In general, the URI has this form arn:aws:apigateway:{region}:lambda:path/{service_api}, where {region} is the same as the region hosting the Lambda function, path indicates that the remaining substring in the URI should be treated as the path to the resource, including the initial /. For Lambda functions, this is usually of the form /2015-03-31/functions/[FunctionARN]/invocations. This property is not supported for JWT authorizers.
authorizerCredentials (string) --
Specifies the required credentials as an IAM role for API Gateway to invoke the authorizer. To specify an IAM role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, specify null. This property is not supported for JWT authorizers.
identitySource (string) --
The identity source for which authorization is requested. For a TOKEN or COGNITO_USER_POOLS authorizer, this is required and specifies the request header mapping expression for the custom header holding the authorization token submitted by the client. For example, if the token header name is Auth, the header mapping expression is method.request.header.Auth. For the REQUEST authorizer, this is required when authorization caching is enabled. The value is a comma-separated string of one or more mapping expressions of the specified request parameters. For example, if an Auth header, a Name query string parameter are defined as identity sources, this value is method.request.header.Auth, method.request.querystring.Name. These parameters will be used to derive the authorization caching key and to perform runtime validation of the REQUEST authorizer by verifying all of the identity-related request parameters are present, not null and non-empty. Only when this is true does the authorizer invoke the authorizer Lambda function, otherwise, it returns a 401 Unauthorized response without calling the Lambda function. The valid value is a string of comma-separated mapping expressions of the specified request parameters. When the authorization caching is not enabled, this property is optional. For a JWT authorizer, this is required and must be a single request-header mapping expression, method.request.header.<name>, for example, method.request.header.Authorization. Query string parameters are not supported, and there is no default.
identityValidationExpression (string) --
A validation expression for the incoming identity token. For TOKEN authorizers, this value is a regular expression. For COGNITO_USER_POOLS authorizers, API Gateway will match the aud field of the incoming token from the client against the specified regular expression. It will invoke the authorizer's Lambda function when there is a match. Otherwise, it will return a 401 Unauthorized response without calling the Lambda function. The validation expression does not apply to the REQUEST or JWT authorizer.
authorizerResultTtlInSeconds (integer) --
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.
jwtConfiguration (dict) --
The configuration returned for a JWT authorizer. This field is present only when type is JWT.
issuers (list) --
The trusted issuers configured for the authorizer.
(dict) --
A trusted issuer in the returned JWT configuration.
issuer (string) --
The OpenID Connect (OIDC) issuer URL.
audiences (list) --
The audiences that the issuer can issue tokens for.
(string) --
additionalClaims (list) --
The additional claim rules configured for this issuer.
(dict) --
An additional claim rule for an issuer.
claimName (string) --
The name of the claim to check. The value cannot be empty and cannot be iss, aud, exp, nbf, iat, scope, or scp.
format (string) --
The format of the claim value. The only valid value is SINGLE_STRING.
required (boolean) --
Specifies whether the claim must be present in the token. Defaults to false. When true, the token must contain the claim.
expectedValues (list) --
The accepted value for the claim. The value cannot be empty. When a value is specified, the claim must match it exactly, and the match is case-sensitive. When no value is specified, the claim only has to be present.
(string) --
jwksUri (string) --
The JSON Web Key Set (JWKS) URI that API Gateway resolved from the issuer's OpenID Connect discovery document. This value is read-only and cannot be set.
defaultAlgorithms (list) --
The signing algorithms configured for the authorizer.
(string) --
A JSON Web Signature (JWS) signing algorithm. Valid values are RS256, RS384, RS512, ES256, ES384, and ES512. HMAC ( HS256, HS384, HS512) and none are not valid values.
{'jwtConfiguration': {'defaultAlgorithms': ['RS256 | RS384 | RS512 | ES256 | '
'ES384 | ES512'],
'issuers': [{'additionalClaims': [{'claimName': 'string',
'expectedValues': ['string'],
'format': 'SINGLE_STRING',
'required': 'boolean'}],
'audiences': ['string'],
'issuer': 'string',
'jwksUri': 'string'}]},
'type': {'JWT'}}
Describe an existing Authorizer resource.
See also: AWS API Documentation
Request Syntax
client.get_authorizer(
restApiId='string',
authorizerId='string'
)
string
[REQUIRED]
The string identifier of the associated RestApi.
string
[REQUIRED]
The identifier of the Authorizer resource.
dict
Response Syntax
{
'id': 'string',
'name': 'string',
'type': 'TOKEN'|'REQUEST'|'COGNITO_USER_POOLS'|'JWT',
'providerARNs': [
'string',
],
'authType': 'string',
'authorizerUri': 'string',
'authorizerCredentials': 'string',
'identitySource': 'string',
'identityValidationExpression': 'string',
'authorizerResultTtlInSeconds': 123,
'jwtConfiguration': {
'issuers': [
{
'issuer': 'string',
'audiences': [
'string',
],
'additionalClaims': [
{
'claimName': 'string',
'format': 'SINGLE_STRING',
'required': True|False,
'expectedValues': [
'string',
]
},
],
'jwksUri': 'string'
},
],
'defaultAlgorithms': [
'RS256'|'RS384'|'RS512'|'ES256'|'ES384'|'ES512',
]
}
}
Response Structure
(dict) --
Represents an authorization layer for methods. If enabled on a method, API Gateway will activate the authorizer when a client calls the method.
id (string) --
The identifier for the authorizer resource.
name (string) --
The name of the authorizer.
type (string) --
The authorizer type. Valid values are TOKEN for a Lambda function using a single authorization token submitted in a custom header, REQUEST for a Lambda function using incoming request parameters, COGNITO_USER_POOLS for using an Amazon Cognito user pool, and JWT for using a native JWT authorizer with the trusted issuers, audiences, and signing algorithms that you declare.
providerARNs (list) --
A list of the Amazon Cognito user pool ARNs for the COGNITO_USER_POOLS authorizer. Each element is of this format: arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}. For a TOKEN or REQUEST authorizer, this is not defined. This property is not supported for JWT authorizers.
(string) --
authType (string) --
Optional customer-defined field, used in OpenAPI imports and exports without functional impact.
authorizerUri (string) --
Specifies the authorizer's Uniform Resource Identifier (URI). For TOKEN or REQUEST authorizers, this must be a well-formed Lambda function URI, for example, arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations. In general, the URI has this form arn:aws:apigateway:{region}:lambda:path/{service_api}, where {region} is the same as the region hosting the Lambda function, path indicates that the remaining substring in the URI should be treated as the path to the resource, including the initial /. For Lambda functions, this is usually of the form /2015-03-31/functions/[FunctionARN]/invocations. This property is not supported for JWT authorizers.
authorizerCredentials (string) --
Specifies the required credentials as an IAM role for API Gateway to invoke the authorizer. To specify an IAM role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, specify null. This property is not supported for JWT authorizers.
identitySource (string) --
The identity source for which authorization is requested. For a TOKEN or COGNITO_USER_POOLS authorizer, this is required and specifies the request header mapping expression for the custom header holding the authorization token submitted by the client. For example, if the token header name is Auth, the header mapping expression is method.request.header.Auth. For the REQUEST authorizer, this is required when authorization caching is enabled. The value is a comma-separated string of one or more mapping expressions of the specified request parameters. For example, if an Auth header, a Name query string parameter are defined as identity sources, this value is method.request.header.Auth, method.request.querystring.Name. These parameters will be used to derive the authorization caching key and to perform runtime validation of the REQUEST authorizer by verifying all of the identity-related request parameters are present, not null and non-empty. Only when this is true does the authorizer invoke the authorizer Lambda function, otherwise, it returns a 401 Unauthorized response without calling the Lambda function. The valid value is a string of comma-separated mapping expressions of the specified request parameters. When the authorization caching is not enabled, this property is optional. For a JWT authorizer, this is required and must be a single request-header mapping expression, method.request.header.<name>, for example, method.request.header.Authorization. Query string parameters are not supported, and there is no default.
identityValidationExpression (string) --
A validation expression for the incoming identity token. For TOKEN authorizers, this value is a regular expression. For COGNITO_USER_POOLS authorizers, API Gateway will match the aud field of the incoming token from the client against the specified regular expression. It will invoke the authorizer's Lambda function when there is a match. Otherwise, it will return a 401 Unauthorized response without calling the Lambda function. The validation expression does not apply to the REQUEST or JWT authorizer.
authorizerResultTtlInSeconds (integer) --
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.
jwtConfiguration (dict) --
The configuration returned for a JWT authorizer. This field is present only when type is JWT.
issuers (list) --
The trusted issuers configured for the authorizer.
(dict) --
A trusted issuer in the returned JWT configuration.
issuer (string) --
The OpenID Connect (OIDC) issuer URL.
audiences (list) --
The audiences that the issuer can issue tokens for.
(string) --
additionalClaims (list) --
The additional claim rules configured for this issuer.
(dict) --
An additional claim rule for an issuer.
claimName (string) --
The name of the claim to check. The value cannot be empty and cannot be iss, aud, exp, nbf, iat, scope, or scp.
format (string) --
The format of the claim value. The only valid value is SINGLE_STRING.
required (boolean) --
Specifies whether the claim must be present in the token. Defaults to false. When true, the token must contain the claim.
expectedValues (list) --
The accepted value for the claim. The value cannot be empty. When a value is specified, the claim must match it exactly, and the match is case-sensitive. When no value is specified, the claim only has to be present.
(string) --
jwksUri (string) --
The JSON Web Key Set (JWKS) URI that API Gateway resolved from the issuer's OpenID Connect discovery document. This value is read-only and cannot be set.
defaultAlgorithms (list) --
The signing algorithms configured for the authorizer.
(string) --
A JSON Web Signature (JWS) signing algorithm. Valid values are RS256, RS384, RS512, ES256, ES384, and ES512. HMAC ( HS256, HS384, HS512) and none are not valid values.
{'items': {'jwtConfiguration': {'defaultAlgorithms': ['RS256 | RS384 | RS512 | '
'ES256 | ES384 | ES512'],
'issuers': [{'additionalClaims': [{'claimName': 'string',
'expectedValues': ['string'],
'format': 'SINGLE_STRING',
'required': 'boolean'}],
'audiences': ['string'],
'issuer': 'string',
'jwksUri': 'string'}]},
'type': {'JWT'}}}
Describe an existing Authorizers resource.
See also: AWS API Documentation
Request Syntax
client.get_authorizers(
restApiId='string',
position='string',
limit=123
)
string
[REQUIRED]
The string identifier of the associated RestApi.
string
The current pagination position in the paged result set.
integer
The maximum number of returned results per page. The default value is 25 and the maximum value is 500.
dict
Response Syntax
{
'position': 'string',
'items': [
{
'id': 'string',
'name': 'string',
'type': 'TOKEN'|'REQUEST'|'COGNITO_USER_POOLS'|'JWT',
'providerARNs': [
'string',
],
'authType': 'string',
'authorizerUri': 'string',
'authorizerCredentials': 'string',
'identitySource': 'string',
'identityValidationExpression': 'string',
'authorizerResultTtlInSeconds': 123,
'jwtConfiguration': {
'issuers': [
{
'issuer': 'string',
'audiences': [
'string',
],
'additionalClaims': [
{
'claimName': 'string',
'format': 'SINGLE_STRING',
'required': True|False,
'expectedValues': [
'string',
]
},
],
'jwksUri': 'string'
},
],
'defaultAlgorithms': [
'RS256'|'RS384'|'RS512'|'ES256'|'ES384'|'ES512',
]
}
},
]
}
Response Structure
(dict) --
Represents a collection of Authorizer resources.
position (string) --
items (list) --
The current page of elements from this collection.
(dict) --
Represents an authorization layer for methods. If enabled on a method, API Gateway will activate the authorizer when a client calls the method.
id (string) --
The identifier for the authorizer resource.
name (string) --
The name of the authorizer.
type (string) --
The authorizer type. Valid values are TOKEN for a Lambda function using a single authorization token submitted in a custom header, REQUEST for a Lambda function using incoming request parameters, COGNITO_USER_POOLS for using an Amazon Cognito user pool, and JWT for using a native JWT authorizer with the trusted issuers, audiences, and signing algorithms that you declare.
providerARNs (list) --
A list of the Amazon Cognito user pool ARNs for the COGNITO_USER_POOLS authorizer. Each element is of this format: arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}. For a TOKEN or REQUEST authorizer, this is not defined. This property is not supported for JWT authorizers.
(string) --
authType (string) --
Optional customer-defined field, used in OpenAPI imports and exports without functional impact.
authorizerUri (string) --
Specifies the authorizer's Uniform Resource Identifier (URI). For TOKEN or REQUEST authorizers, this must be a well-formed Lambda function URI, for example, arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations. In general, the URI has this form arn:aws:apigateway:{region}:lambda:path/{service_api}, where {region} is the same as the region hosting the Lambda function, path indicates that the remaining substring in the URI should be treated as the path to the resource, including the initial /. For Lambda functions, this is usually of the form /2015-03-31/functions/[FunctionARN]/invocations. This property is not supported for JWT authorizers.
authorizerCredentials (string) --
Specifies the required credentials as an IAM role for API Gateway to invoke the authorizer. To specify an IAM role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, specify null. This property is not supported for JWT authorizers.
identitySource (string) --
The identity source for which authorization is requested. For a TOKEN or COGNITO_USER_POOLS authorizer, this is required and specifies the request header mapping expression for the custom header holding the authorization token submitted by the client. For example, if the token header name is Auth, the header mapping expression is method.request.header.Auth. For the REQUEST authorizer, this is required when authorization caching is enabled. The value is a comma-separated string of one or more mapping expressions of the specified request parameters. For example, if an Auth header, a Name query string parameter are defined as identity sources, this value is method.request.header.Auth, method.request.querystring.Name. These parameters will be used to derive the authorization caching key and to perform runtime validation of the REQUEST authorizer by verifying all of the identity-related request parameters are present, not null and non-empty. Only when this is true does the authorizer invoke the authorizer Lambda function, otherwise, it returns a 401 Unauthorized response without calling the Lambda function. The valid value is a string of comma-separated mapping expressions of the specified request parameters. When the authorization caching is not enabled, this property is optional. For a JWT authorizer, this is required and must be a single request-header mapping expression, method.request.header.<name>, for example, method.request.header.Authorization. Query string parameters are not supported, and there is no default.
identityValidationExpression (string) --
A validation expression for the incoming identity token. For TOKEN authorizers, this value is a regular expression. For COGNITO_USER_POOLS authorizers, API Gateway will match the aud field of the incoming token from the client against the specified regular expression. It will invoke the authorizer's Lambda function when there is a match. Otherwise, it will return a 401 Unauthorized response without calling the Lambda function. The validation expression does not apply to the REQUEST or JWT authorizer.
authorizerResultTtlInSeconds (integer) --
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.
jwtConfiguration (dict) --
The configuration returned for a JWT authorizer. This field is present only when type is JWT.
issuers (list) --
The trusted issuers configured for the authorizer.
(dict) --
A trusted issuer in the returned JWT configuration.
issuer (string) --
The OpenID Connect (OIDC) issuer URL.
audiences (list) --
The audiences that the issuer can issue tokens for.
(string) --
additionalClaims (list) --
The additional claim rules configured for this issuer.
(dict) --
An additional claim rule for an issuer.
claimName (string) --
The name of the claim to check. The value cannot be empty and cannot be iss, aud, exp, nbf, iat, scope, or scp.
format (string) --
The format of the claim value. The only valid value is SINGLE_STRING.
required (boolean) --
Specifies whether the claim must be present in the token. Defaults to false. When true, the token must contain the claim.
expectedValues (list) --
The accepted value for the claim. The value cannot be empty. When a value is specified, the claim must match it exactly, and the match is case-sensitive. When no value is specified, the claim only has to be present.
(string) --
jwksUri (string) --
The JSON Web Key Set (JWKS) URI that API Gateway resolved from the issuer's OpenID Connect discovery document. This value is read-only and cannot be set.
defaultAlgorithms (list) --
The signing algorithms configured for the authorizer.
(string) --
A JSON Web Signature (JWS) signing algorithm. Valid values are RS256, RS384, RS512, ES256, ES384, and ES512. HMAC ( HS256, HS384, HS512) and none are not valid values.
{'jwtConfiguration': {'defaultAlgorithms': ['RS256 | RS384 | RS512 | ES256 | '
'ES384 | ES512'],
'issuers': [{'additionalClaims': [{'claimName': 'string',
'expectedValues': ['string'],
'format': 'SINGLE_STRING',
'required': 'boolean'}],
'audiences': ['string'],
'issuer': 'string',
'jwksUri': 'string'}]},
'type': {'JWT'}}
Updates an existing Authorizer resource. For a JWT authorizer, the only JWT patch operation is replace on the path /jwtConfiguration. Its value is the complete configuration as a JSON string in the JwtConfigurationInput shape. This replaces the entire configuration; nothing from the previous configuration is retained. A replace operation on the path /type is supported in both directions.
See also: AWS API Documentation
Request Syntax
client.update_authorizer(
restApiId='string',
authorizerId='string',
patchOperations=[
{
'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
'path': 'string',
'value': 'string',
'from': 'string'
},
]
)
string
[REQUIRED]
The string identifier of the associated RestApi.
string
[REQUIRED]
The identifier of the Authorizer resource.
list
For more information about supported patch operations, see Patch Operations.
(dict) --
For more information about supported patch operations, see Patch Operations.
op (string) --
An update operation to be performed with this PATCH request. The valid value can be add, remove, replace or copy. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message..
path (string) --
The op operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of {"name":"value"}, the path for this property is /name. If the name property value is a JSON object (e.g., {"name": {"child/name": "child-value"}}), the path for the child/name property will be /name/child~1name. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Each op operation can have only one path associated with it.
value (string) --
The new target value of the update operation. It is applicable for the add or replace operation. When using CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '{"a": ...}'.
from (string) --
The copy update operation's source as identified by a JSON-Pointer value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with "op":"copy", "from":"/canarySettings/deploymentId" and "path":"/deploymentId".
dict
Response Syntax
{
'id': 'string',
'name': 'string',
'type': 'TOKEN'|'REQUEST'|'COGNITO_USER_POOLS'|'JWT',
'providerARNs': [
'string',
],
'authType': 'string',
'authorizerUri': 'string',
'authorizerCredentials': 'string',
'identitySource': 'string',
'identityValidationExpression': 'string',
'authorizerResultTtlInSeconds': 123,
'jwtConfiguration': {
'issuers': [
{
'issuer': 'string',
'audiences': [
'string',
],
'additionalClaims': [
{
'claimName': 'string',
'format': 'SINGLE_STRING',
'required': True|False,
'expectedValues': [
'string',
]
},
],
'jwksUri': 'string'
},
],
'defaultAlgorithms': [
'RS256'|'RS384'|'RS512'|'ES256'|'ES384'|'ES512',
]
}
}
Response Structure
(dict) --
Represents an authorization layer for methods. If enabled on a method, API Gateway will activate the authorizer when a client calls the method.
id (string) --
The identifier for the authorizer resource.
name (string) --
The name of the authorizer.
type (string) --
The authorizer type. Valid values are TOKEN for a Lambda function using a single authorization token submitted in a custom header, REQUEST for a Lambda function using incoming request parameters, COGNITO_USER_POOLS for using an Amazon Cognito user pool, and JWT for using a native JWT authorizer with the trusted issuers, audiences, and signing algorithms that you declare.
providerARNs (list) --
A list of the Amazon Cognito user pool ARNs for the COGNITO_USER_POOLS authorizer. Each element is of this format: arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}. For a TOKEN or REQUEST authorizer, this is not defined. This property is not supported for JWT authorizers.
(string) --
authType (string) --
Optional customer-defined field, used in OpenAPI imports and exports without functional impact.
authorizerUri (string) --
Specifies the authorizer's Uniform Resource Identifier (URI). For TOKEN or REQUEST authorizers, this must be a well-formed Lambda function URI, for example, arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations. In general, the URI has this form arn:aws:apigateway:{region}:lambda:path/{service_api}, where {region} is the same as the region hosting the Lambda function, path indicates that the remaining substring in the URI should be treated as the path to the resource, including the initial /. For Lambda functions, this is usually of the form /2015-03-31/functions/[FunctionARN]/invocations. This property is not supported for JWT authorizers.
authorizerCredentials (string) --
Specifies the required credentials as an IAM role for API Gateway to invoke the authorizer. To specify an IAM role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, specify null. This property is not supported for JWT authorizers.
identitySource (string) --
The identity source for which authorization is requested. For a TOKEN or COGNITO_USER_POOLS authorizer, this is required and specifies the request header mapping expression for the custom header holding the authorization token submitted by the client. For example, if the token header name is Auth, the header mapping expression is method.request.header.Auth. For the REQUEST authorizer, this is required when authorization caching is enabled. The value is a comma-separated string of one or more mapping expressions of the specified request parameters. For example, if an Auth header, a Name query string parameter are defined as identity sources, this value is method.request.header.Auth, method.request.querystring.Name. These parameters will be used to derive the authorization caching key and to perform runtime validation of the REQUEST authorizer by verifying all of the identity-related request parameters are present, not null and non-empty. Only when this is true does the authorizer invoke the authorizer Lambda function, otherwise, it returns a 401 Unauthorized response without calling the Lambda function. The valid value is a string of comma-separated mapping expressions of the specified request parameters. When the authorization caching is not enabled, this property is optional. For a JWT authorizer, this is required and must be a single request-header mapping expression, method.request.header.<name>, for example, method.request.header.Authorization. Query string parameters are not supported, and there is no default.
identityValidationExpression (string) --
A validation expression for the incoming identity token. For TOKEN authorizers, this value is a regular expression. For COGNITO_USER_POOLS authorizers, API Gateway will match the aud field of the incoming token from the client against the specified regular expression. It will invoke the authorizer's Lambda function when there is a match. Otherwise, it will return a 401 Unauthorized response without calling the Lambda function. The validation expression does not apply to the REQUEST or JWT authorizer.
authorizerResultTtlInSeconds (integer) --
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.
jwtConfiguration (dict) --
The configuration returned for a JWT authorizer. This field is present only when type is JWT.
issuers (list) --
The trusted issuers configured for the authorizer.
(dict) --
A trusted issuer in the returned JWT configuration.
issuer (string) --
The OpenID Connect (OIDC) issuer URL.
audiences (list) --
The audiences that the issuer can issue tokens for.
(string) --
additionalClaims (list) --
The additional claim rules configured for this issuer.
(dict) --
An additional claim rule for an issuer.
claimName (string) --
The name of the claim to check. The value cannot be empty and cannot be iss, aud, exp, nbf, iat, scope, or scp.
format (string) --
The format of the claim value. The only valid value is SINGLE_STRING.
required (boolean) --
Specifies whether the claim must be present in the token. Defaults to false. When true, the token must contain the claim.
expectedValues (list) --
The accepted value for the claim. The value cannot be empty. When a value is specified, the claim must match it exactly, and the match is case-sensitive. When no value is specified, the claim only has to be present.
(string) --
jwksUri (string) --
The JSON Web Key Set (JWKS) URI that API Gateway resolved from the issuer's OpenID Connect discovery document. This value is read-only and cannot be set.
defaultAlgorithms (list) --
The signing algorithms configured for the authorizer.
(string) --
A JSON Web Signature (JWS) signing algorithm. Valid values are RS256, RS384, RS512, ES256, ES384, and ES512. HMAC ( HS256, HS384, HS512) and none are not valid values.