-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add Support for AuthorizationType to API #49
Comments
If I'm understanding you correctly, have you tried defining what you're trying to get in the console and exporting the swagger file? I've found that my SAM templates support Cognito Authorization definitions by exporting an existing API built in the console and just using it as a starting point. |
Agreed, it is possible to make this work with a Swagger file, but that feels like an unnecessary step (export Swagger, modify, upload + manage separately) for something reasonably simple to configure as part of the API definition. |
Thanks for the request. This is a good feature to have. |
It looks like using Swagger stopped working. This was previously working:
But now I get:
What is the correct syntax now? |
@mparaz, try nesting the authorizerUri value under a Fn::Sub element, i.e.:
|
I don't think the Fn::Sub will help here. That looks to be an API Gateway stage variable rather than a CloudFormation variable. |
does not seem to work for me in an inline swagger file and fails with the following error: Could someone confirm that this should work? Or maybe there is another way to access these variables with an inline swagger spec? |
Its happening! #248 |
Whew, I spent most of the day trying to understand the workarounds and just checked this issue a few minutes ago! :-) Does #248 mean it will be straightforward to declare a AWS::ApiGateway::Authorizer resource with Type: "Cognito_user_pool"? |
New to AWS, and I am incredibly interested in the CORS/Authorizer thing. (As I want to build a web stack using Cognito). |
@sanathkr Still don't understand what I should use for adding Authorizer to my Api Event. Where I can found any documentation about it? |
@WilixLead Authorizer is not yet supported natively in SAM. #248 is parent tracking issue for all APIGW features. You can always enable custom authorizers by explicitly defining APIs using Swagger file and including the Swagger with |
I got really confused with this.
I struggle to understand if Cognito is considered as a custom authorizer or not ? Thanks a lot in advance! |
If you're interested in Authorizers and want to help shape the syntax, the RFC is over here #512. I'm going to extend the RFC closure date until end of this week. @jkahn117 @collinforrester @mparaz @demurray @WilixLead @marczis @johnbest @jaccus @lafiosca |
See #546 for recently added support |
API Endpoints often require authorization permissions, e.g. only IAM users. Ideally, AWS::Serverless::Api would also support AuthorizationType available for API Gateway.
For example, using IAM user:
Or a custom authorizer:
Realize this may be challenging in referencing the custom authorizer function if not a function defined within the template though.
The text was updated successfully, but these errors were encountered: