Menu
AWS IoT
Developer Guide

TestInvokeAuthorizer

Invoke the specified custom authorizer for testing purposes.

Request syntax:

POST /authorizer/authorizerName/test Content-type: application/json { "token": "string", "tokenSignature": "string" }

URI Request Parameters:

Name

Type

Req?

Description

authorizerName

AuthorizerName

yes

The custom authorizer name.

Request Body Parameters:

Name

Type

Req?

Description

token

Token

yes

The token returned by your custom authentication service.

tokenSignature

TokenSignature

yes

The signature made with the token and your custom authentication service's private key.

Response syntax:

Content-type: application/json { "isAuthenticated": "boolean", "principalId": "string", "policyDocuments": [ "string" ], "refreshAfterInSeconds": "integer", "disconnectAfterInSeconds": "integer" }

Response Body Parameters:

Name

Type

Req?

Description

isAuthenticated

IsAuthenticated

no

True if the token is authenticated, otherwise false.

principalId

PrincipalId

no

The principal ID.

policyDocuments

PolicyDocuments

no

IAM policy documents.

refreshAfterInSeconds

Seconds

no

The number of seconds after which the temporary credentials are refreshed.

disconnectAfterInSeconds

Seconds

no

The number of seconds after which the connection is terminated.

Errors:

ResourceNotFoundException

The specified resource does not exist.

HTTP response code: 404

InvalidRequestException

The contents of the request were invalid. For example, this code is returned when an UpdateJobExecution request contains invalid status details. The message contains details about the error.

HTTP response code: 400

ThrottlingException

The rate exceeds the limit.

HTTP response code: 429

UnauthorizedException

You are not authorized to perform this operation.

HTTP response code: 401

ServiceUnavailableException

The service is temporarily unavailable.

HTTP response code: 503

InternalFailureException

An unexpected error has occurred.

HTTP response code: 500

InvalidResponseException

The response is invalid.

HTTP response code: 400

CLI

Synopsis:

aws iot test-invoke-authorizer \ --authorizer-name <value> \ --token <value> \ --token-signature <value> \ [--cli-input-json <value>] \ [--generate-cli-skeleton]

cli-input-json format:

{ "authorizerName": "string", "token": "string", "tokenSignature": "string" }

cli-input-json fields:

Name

Type

Description

authorizerName

string

length max:128 min:1

pattern: [w=,@-]+

The custom authorizer name.

token

string

length max:1024 min:1

The token returned by your custom authentication service.

tokenSignature

string

length max:2560 min:1

pattern: [A-Za-z0-9+/]+={0,2}

The signature made with the token and your custom authentication service's private key.

Output:

{ "isAuthenticated": "boolean", "principalId": "string", "policyDocuments": [ "string" ], "refreshAfterInSeconds": "integer", "disconnectAfterInSeconds": "integer" }

cli output fields:

Name

Type

Description

isAuthenticated

boolean

java class: java.lang.Boolean

True if the token is authenticated, otherwise false.

principalId

string

length max:128 min:1

pattern: [a-zA-Z0-9]+

The principal ID.

policyDocuments

list

member: PolicyDocument

IAM policy documents.

PolicyDocument

string

refreshAfterInSeconds

integer

java class: java.lang.Integer

The number of seconds after which the temporary credentials are refreshed.

disconnectAfterInSeconds

integer

java class: java.lang.Integer

The number of seconds after which the connection is terminated.

On this page: