#Store user data to reduce latency

4 messages · Page 1 of 1 (latest)

tough rock
#

Hey,
So my users are giving us a secret API key when registering.
This API key is to be used by our backend to make some API calls.
The problem is, at the moment, the keys are encrypted using KMS.
So when the backend is called, it first need to retrieve the key, decrypt it, and then use it to make the external API call.
This creates a lot of latency, which is a problem for our use case.

I was wondering if I could retrieve the key when the user login, and store it somewhere (safe haha), so that it can easily be used by the backend.

Obviously, the key is very sensible, so I don't really know how to approach this. Is it even possible ?
thanks!

tough rock
#

any ideas please ?

tough rock
#

I had an idea, but can you guys please tell me if its secure:
When the user login, I can generate a "client" object, wich already contains the API keys. So for example, using the facebook API; you generate a client object, using the secret api key, and store that on your frontend. So that you can pass it as an argument to your backend when needed?

fickle pawn
#

If the client ever gets access to your secrets it wouldn’t be secure