Authenticate MQTT and HTTPS clients to AWS IoT Core using a Lambda-backed custom authorizer instead of X.509 certificates
domain: docs.aws.amazon.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Write a Lambda function that validates an incoming token and returns isAuthenticated, principalId, policyDocuments, disconnectAfterInSeconds, and refreshAfterInSeconds
Register the authorizer with the CreateAuthorizer API/CLI, specifying the Lambda ARN and, if using token signing, a token key name and signing public key
Grant AWS IoT Core permission to invoke the Lambda via lambda add-permission
Test the authorizer with the TestInvokeAuthorizer API/CLI before using it live
Have clients pass the authorizer name via the x-amz-customauthorizer-name header (HTTPS/WSS) or the MQTT CONNECT username/password fields
If the default IoT endpoint does not route to the authorizer, create a custom domain configuration and attach the authorizer to it
Known gotchas
The authorizer Lambda has a short hard timeout - slow validation logic will fail authentication
Accounts have a limit on the number of custom authorizers; hitting it requires deactivating or deleting unused ones since an active one cannot be deleted
Idle connections may be re-validated after a delay and then follow refreshAfterInSeconds - plan token/session refresh accordingly
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?