-
Notifications
You must be signed in to change notification settings - Fork 79
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
AWS Amplify set "API key required" to True for a path in an API Gateway REST API #3112
Comments
Hey @aranbit, Thank you for bringing this up. Unfortunately, API key authentication for REST APIs is not supported. You can refer to this section of the documentation for the supported authentication methods. Additionally, a similar issue was raised previously—please check this ticket for more details. aws-amplify/amplify-cli#13454 |
I see the similar ticket that the implementation looks to provide the functionality I need but it is in javascript, I'm using Flutter with Amplify Gen 1, so no CDK, how can I achieve this behavior to set the "API Required Flag" to "True" for the specifc functions, same as shown in the other ticket? Below is the relevent implementation that I'm looking to do just with Flutter and AWS Amplify Gen 1:
|
Hi @aranbit, Thank you for your response. you can try implementing the above solution by overriding the REST API using the CLI. You can refer to this section of the documentation for detailed guidance: Let me know if this resolves your issue! |
H, I did have one thing that I don't yet understand how to do that I could use your help: Using AWS Amplify there is a {+proxy} path that is created with every API Gateway path, so I didn't understand how to to set the api key required for that path. The following is my code to set API key authorization for specific functions (what I'm missing is for their {+proxy} path:
|
Hey @aranbit, Can you try adding the code snippet below to see if it resolves your issue?
|
I have managed to successfully achieve it! Slightly simplified the code:
|
This issue is now closed. Comments on closed issues are hard for our team to see. |
Amplify CLI Version
12.14.0
Question
I have an Amplify app that has an API Gateway REST API.
I created some that are used for users of the application with AWS_IAM authorization which works great, but I also created paths that I would like to give access to external users with an API Key and a Usage Plan.
I have configured everything from the console (the api key and the usage plan), but the issue I encountered is how do I set the "API key required" flag to true from the cli on specific paths, because when I do it manually and then make some other changes to the api using the Amplify CLI, when deployed it overrides the manual change...
How can I set that the "API key required" flag to True for specific paths in my REST API using the Amplify CLI or in a way that it won't be overriden?
The text was updated successfully, but these errors were encountered: