This sample demonstrates a WebSocket API with request authorization and Cognito user authentication flows.
- A valid LocalStack for AWS license. Your license provides a
LOCALSTACK_AUTH_TOKEN. - Docker
localstackCLIawslocalCLI- Terraform
makeandjq
export LOCALSTACK_AUTH_TOKEN=<your-auth-token>
make start
make readyterraform init; terraform plan; terraform apply --auto-approve
Using the outputs run the following commands,
awslocal cognito-idp sign-up \
--client-id <user_pool_client_id> \
--username "user@domain.com" \
--password "Ppassword123!"
then,
awslocal cognito-idp admin-confirm-sign-up \
--user-pool-id <user_pool_id> \
--username "user@domain.com"
then,
awslocal cognito-idp initiate-auth \
--auth-flow USER_PASSWORD_AUTH \
--auth-parameters USERNAME="user@domain.com",PASSWORD="password" \
--client-id <user_pool_client_id>