How to access to secrets in static site hosted in S3 bucket

Viewed 721

I'm new and since I could not find relevant information in my searches I decided to ask for your advice.

I created a SPA (React) that receives a token, validates the token and if the token is valid it renders some content. That SPA is hosted in S3.

Now, I want to add some API keys (sensitive ones). Adding them to the code (manually or during the build of the bundle) it would be a bad idea, no?

I thought about storing them in AWS, like in secrets manager, and use the SDK (js) to retrieve them. But here is my doubt. I don't want neither to hardcode the AWS credentials in the code for the SDK, nor use something like cognito since the authentication would be done by this app through the token that it receives. What would be the best way to achieve this? I will appreciate advice and if you can point to some resources.

Feel free to make as many suggestions as you want. Thanks.

0 Answers
Related