Recently I've created an app using a Vie.js framework and for the backend, I've used Laravel. Now the problem is that how would you store the API keys (client_secret) securely inside the Vue, which is used to authenticate the users? So they are not exposed to anyone who knows how to use the browsers' dev tool.
-
Possible duplicate of How to protect an API Key when using JavaScript?yuriy636– yuriy6362018-01-13 11:25:07 +00:00Commented Jan 13, 2018 at 11:25
-
That's a server-side's job. You should decide on the server side if that user is authorized to perform some action. Simplest solution would be to not only check secret key, but also their IP, user agent.CyberAP– CyberAP2018-01-13 11:44:16 +00:00Commented Jan 13, 2018 at 11:44
-
The api key should be different for each authenticated user, and should expire and require refresh after some time. Try learning how others use JSON web token. Easiest way : try using auth0(may not be free) on both clients and server.Jacob Goh– Jacob Goh2018-01-13 12:30:58 +00:00Commented Jan 13, 2018 at 12:30
Add a comment
|