-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Open
Labels
status: triage neededRequires evaluation by maintainersRequires evaluation by maintainerstype: bugBug reportBug report
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
When I authorize API endpoint with HttpUserPoolAuthorizer
from aws-cdk-lib/aws-apigatewayv2-authorizers
.
It always returns Unauthorized
with 401 status code with valid Access Token.
Expected Behavior
Should return 200 status.
How are you starting LocalStack?
With a docker-compose file
Steps To Reproduce
Reproduction repository.
https://github.com/yuki0418/localstack-unauthorize-repro
Requirements
- pnpm
- Docker
- LocalStack Pro
Setup
- Run LocalStack Pro
$ export LOCALSTACK_AUTH_TOKEN="<your_localstack_pro_auth_token>"
$ docker compose up
Reproduction Steps
- Install packages
$ pnpm install
- Bootstrap adn deploy the CDK environment
$ cdklocal bootstrap
$ cdklocal deploy --all --require-approval never
- Sign up a user
curl -X POST 'https://test.execute-api.localhost.localstack.cloud:4566/user/signup' \
-H "Content-Type: application/json" \
-d '{"email": "test@example.com", "password": "P@ss1234", "firstName": "Yuki", "lastName": "Ishii"}'
- Confirm the user
You can get the confirmation code from the docker logs
curl -X POST 'https://test.execute-api.localhost.localstack.cloud:4566/user/confirm' \
-H "Content-Type: application/json" \
-d '{"email": "test@example.com", "confirmationCode": "<confirmation_code>"}'
- Sign in the user to get the access token
curl -X POST 'https://test.execute-api.localhost.localstack.cloud:4566/user/signin' \
-H "Content-Type: application/json" \
-d '{"email": "test@example.com", "password": "P@ss1234"}'
You will get the access token and IdToken in the response.
- Change the email address
curl -X POST 'https://test.execute-api.localhost.localstack.cloud:4566/user/email' \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <Access Token>" \
-d '{"email": "test+1@example.com"}'
You will get with
HTTP/2 401
server: TwistedWeb/24.3.0
date: Sat, 26 Jul 2025 02:44:36 GMT
content-type: application/json
apigw-requestid: 18e4f871
content-length: 26
{"message":"Unauthorized"}%
Environment
- OS:
- LocalStack:
LocalStack version:
LocalStack Docker image sha:
LocalStack build date:
LocalStack build git hash:
- OS:macOS Sonoma v14.6.1
- LocalStack: localstack/localstack-pro
LocalStack version: latest, 4.6
LocalStack Docker image sha: sha256:5564ec44adbb363e77c4587a99e7fb0259e077f3afdb4dd5427b11b2ca3e4898
Anything else?
No response
Metadata
Metadata
Assignees
Labels
status: triage neededRequires evaluation by maintainersRequires evaluation by maintainerstype: bugBug reportBug report