Tests a custom authorization behavior by invoking a specified custom authorizer. Use this to test and debug the custom authorization behavior of devices that connect to the IoT device gateway.
Requires permission to access the TestInvokeAuthorizer action.
See also: AWS API Documentation
Request Syntax
response = client.test_invoke_authorizer(
authorizerName='string',
token='string',
tokenSignature='string',
httpContext={
'headers': {
'string': 'string'
},
'queryString': 'string'
},
mqttContext={
'username': 'string',
'password': b'bytes',
'clientId': 'string'
},
tlsContext={
'serverName': 'string'
}
)
[REQUIRED]
The custom authorizer name.
Specifies a test HTTP authorization request.
The header keys and values in an HTTP authorization request.
The query string keys and values in an HTTP authorization request.
Specifies a test MQTT authorization request.
The value of the username
key in an MQTT authorization request.
The value of the password
key in an MQTT authorization request.
The value of the clientId
key in an MQTT authorization request.
Specifies a test TLS authorization request.
The value of the serverName
key in a TLS authorization request.
dict
Response Syntax
{
'isAuthenticated': True|False,
'principalId': 'string',
'policyDocuments': [
'string',
],
'refreshAfterInSeconds': 123,
'disconnectAfterInSeconds': 123
}
Response Structure
(dict) --
isAuthenticated (boolean) --
True if the token is authenticated, otherwise false.
principalId (string) --
The principal ID.
policyDocuments (list) --
IAM policy documents.
refreshAfterInSeconds (integer) --
The number of seconds after which the temporary credentials are refreshed.
disconnectAfterInSeconds (integer) --
The number of seconds after which the connection is terminated.
Exceptions
IoT.Client.exceptions.ResourceNotFoundException
IoT.Client.exceptions.InvalidRequestException
IoT.Client.exceptions.ThrottlingException
IoT.Client.exceptions.UnauthorizedException
IoT.Client.exceptions.ServiceUnavailableException
IoT.Client.exceptions.InternalFailureException
IoT.Client.exceptions.InvalidResponseException