Open andrybicio opened 1 year ago
Hi @andrybicio, CognitoAuthorizer
is currently not supported as mentioned in the command logs 2023-05-08 12:58:50,998 | Authorizer 'CognitoAuthorizer' is currently unsupported (must be a Lambda Authorizer), skipping
. Marking this as a feature request.
I second the Feature request! My only solution for testing locally is with a fallback user ID in my env vars, which is clumsy and has to be different for every developer
This would be very useful, as it is it's very hard to test anything cognito related locally
If I could amplify this as a feature request - it's very frustrating having to skip over authorisation when working and testing locally.
Would it be possible to utilize the sam sync
command to test Cognito authorizers? This deploys the template to Cloudformation, and any Lambda code changes are synced quickly without having to perform the typical infrastructure changes seen in sam deploy
.
Any guidance on how to run APIs that use Cognito locally?
Description:
I have an API Gateway whose default authorizer is Cognito, except for an endpoint (in this example /hello [GET]). I want to be able to test the API Gateway using Postman and get the whole AWS Lambda flow, in order to have the best developer experience as if I were in the cloud. However, endpoints seem to not be protected, even though I have set it properly. It indeed works in the cloud, and the template for this is the one below.
Steps to reproduce:
This is a part of my
template.yml
Observed result:
The output for the command
sam local start-api --env-vars local.json -p 3001 --debug
Expected result:
I would expect that only the
/hello
endpoint could be triggered without any authorizer, whereas the/info
should have in the header some sort of token as I would do if it were deployed.Additional environment details