-
Notifications
You must be signed in to change notification settings - Fork 963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding jwt cognito pattern for websocket api using lambda authorizer #2384
base: main
Are you sure you want to change the base?
Conversation
1. Note the outputs from the deployment process. It contain the full url link which can be used for testing. | ||
|
||
## Testing | ||
1. Get the Authorization token for your user pool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide informations on how to get the token. Cmd line or GUI click path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use AWS SAM globals section whenever possible (e.g. Lambda Function definitions, Permission, ...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove not needed properties to ease reading and simplify the SAM template, e.g.:
- AWS::Serverless::Function
- Architectures (not required, defaults to x86_64)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there another way to include the code that is not a zip file?
This would count for all zip files. AWS SAM CLI should zip when using sam deploy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sam only has two options, i.e., either provide s3 bucket uri or a local file, so local file has to be zipped before hand.
Co-authored-by: Marco <marco.jahn@gmail.com>
Co-authored-by: Marco <marco.jahn@gmail.com>
Co-authored-by: Marco <marco.jahn@gmail.com>
Co-authored-by: Marco <marco.jahn@gmail.com>
Issue #, if available:
*Description of changes: So basically websocket api doesn't have JWT authorizer by default. This patterns creates a lambda authorizer which verifies the JWT token for cognito and sends a policy back to the websocket api based on valid or invalid token.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.