---
title: "POST /authorizer/{authorizerName}/test"
method: POST
path: "/authorizer/{authorizerName}/test"
---

# POST /authorizer/{authorizerName}/test

`POST /authorizer/{authorizerName}/test`

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](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions) action.

## Path parameters

- `authorizerName` string, required

## Request body

- object
  - `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` object — Specifies the HTTP context to use for the test authorizer request.
    - `headers` object — The header keys and values in an HTTP authorization request.
    - `queryString` string — The query string keys and values in an HTTP authorization request.
  - `mqttContext` object — Specifies the MQTT context to use for the test authorizer request
    - `username` string — The value of the <code>username</code> key in an MQTT authorization request.
    - `password` string — The value of the <code>password</code> key in an MQTT authorization request.
    - `clientId` string — The value of the <code>clientId</code> key in an MQTT authorization request.
  - `tlsContext` object — Specifies the TLS context to use for the test authorizer request.
    - `serverName` string — The value of the <code>serverName</code> key in a TLS authorization request.

## Response `200`

Success

- TestInvokeAuthorizerResponse
  - `isAuthenticated` boolean — True if the token is authenticated, otherwise false.
  - `principalId` string — The principal ID.
  - `policyDocuments` PolicyDocument[] — 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.

## Other responses

- `480` — ResourceNotFoundException
- `481` — InvalidRequestException
- `482` — ThrottlingException
- `483` — UnauthorizedException
- `484` — ServiceUnavailableException
- `485` — InternalFailureException
- `486` — InvalidResponseException

---

[API](https://skmtc.net/aws/apis/iot.md) · [All operations](https://skmtc.net/aws/apis/iot/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/iot/revisions/deef5c4b09f0/schema)
