question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can you programmatically refresh and retrieve an API key?

See original GitHub issue

Which 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:closed
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
SwaySwaycommented, May 26, 2020

@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.

1reaction
SwaySwaycommented, May 18, 2020

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found