IoT / Client / test_invoke_authorizer
test_invoke_authorizer#
- IoT.Client.test_invoke_authorizer(**kwargs)#
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' } )
- Parameters:
authorizerName (string) –
[REQUIRED]
The custom authorizer name.
token (string) – The token returned by your custom authentication service.
tokenSignature (string) – The signature made with the token and your custom authentication service’s private key. This value must be Base-64-encoded.
httpContext (dict) –
Specifies a test HTTP authorization request.
headers (dict) –
The header keys and values in an HTTP authorization request.
(string) –
(string) –
queryString (string) –
The query string keys and values in an HTTP authorization request.
mqttContext (dict) –
Specifies a test MQTT authorization request.
username (string) –
The value of the
usernamekey in an MQTT authorization request.password (bytes) –
The value of the
passwordkey in an MQTT authorization request.clientId (string) –
The value of the
clientIdkey in an MQTT authorization request.
tlsContext (dict) –
Specifies a test TLS authorization request.
serverName (string) –
The value of the
serverNamekey in a TLS authorization request.
- Return type:
dict
- Returns:
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.
(string) –
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.ResourceNotFoundExceptionIoT.Client.exceptions.InvalidRequestExceptionIoT.Client.exceptions.ThrottlingExceptionIoT.Client.exceptions.UnauthorizedExceptionIoT.Client.exceptions.ServiceUnavailableExceptionIoT.Client.exceptions.InternalFailureExceptionIoT.Client.exceptions.InvalidResponseException