Can you programmatically refresh and retrieve an API key?
See original GitHub issueWhich Category is your question related to? Amplify API
Amplify CLI Version
3.0.10
You can use amplify -v
to check the amplify cli version on your system
What AWS Services are you utilizing? Amplify
Provide additional details e.g. code snippets In my current project I wanted to implement a public API with “amplify add api”. As authorization method I chose API key, since anything else would bring much unneeded overhead. I set the API key expiration date to 365 days, but still I’d need a way to refresh the key on a regular basis automatically. Can you refresh the API key from the frontend or via a Lambda function without having to do sth manually in the AWS UI?
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
How do I programmatically refresh an API access token?
A new access token can be created by exchanging your client credentials (application key and secret) with the API. Use our API reference ......
Read more >How refresh google+ api key in c# - Stack Overflow
A really simple Basic API example in C# is here. This project uses the .NET client from NuGet. PlusService plusService = new PlusService( ......
Read more >How to get and automatically refresh APIs data
The solution is to provide the client with an interface in which a database may be reached programmatically (there is programming behind it)....
Read more >How to programmatically retrieve auth code from V2 API
Hi All, When I'm trying to retrieve an auth code to enter into any given request I am trying to make of the...
Read more >Why and when to use API keys | Cloud Endpoints with OpenAPI
While API keys identify the calling project, they don't identify the calling user. For instance, if you have created an application that is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@no-creative-name If your workflow is coming from the CLI then using the lambda function which triggers the build would one solution to rotating the keys. This is something we are aware of as AppSync itself does not currently have an option to rotate the API key. Should you change the value in the AppSync console itself could cause issues as the CLI does not pull changes made to the resources themselves.
I’m going to close this issue for now and review this with the team.
Hello @no-creative-name A current workaround would be to toggle
CreateAPIKey
when you need to refresh your API key. Docs here: https://docs.amplify.aws/cli/graphql-transformer/config-params#createapikey