Simulate the execution of an Authorizer in your RestApi with headers, parameters, and an incoming request body.
See also: AWS API Documentation
Request Syntax
response = client.test_invoke_authorizer(
restApiId='string',
authorizerId='string',
headers={
'string': 'string'
},
multiValueHeaders={
'string': [
'string',
]
},
pathWithQueryString='string',
body='string',
stageVariables={
'string': 'string'
},
additionalContext={
'string': 'string'
}
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
Specifies a test invoke authorizer request's Authorizer ID.
A key-value map of headers to simulate an incoming invocation request. This is where the incoming authorization token, or identity source, should be specified.
The headers as a map from string to list of values to simulate an incoming invocation request. This is where the incoming authorization token, or identity source, may be specified.
A key-value map of stage variables to simulate an invocation on a deployed Stage.
A key-value map of additional context variables.
dict
Response Syntax
{
'clientStatus': 123,
'log': 'string',
'latency': 123,
'principalId': 'string',
'policy': 'string',
'authorization': {
'string': [
'string',
]
},
'claims': {
'string': 'string'
}
}
Response Structure
(dict) --
Represents the response of the test invoke request for a custom Authorizer
clientStatus (integer) --
The HTTP status code that the client would have received. Value is 0 if the authorizer succeeded.
log (string) --
The API Gateway execution log for the test authorizer request.
latency (integer) --
The execution latency of the test authorizer request.
principalId (string) --
The principal identity returned by the Authorizer
policy (string) --
The JSON policy document returned by the Authorizer
authorization (dict) --
The authorization response.
claims (dict) --
The open identity claims, with any supported custom attributes, returned from the Cognito Your User Pool configured for the API.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.TooManyRequestsException