Threadser.net
數據
關鍵字
功能建議
Following
Threads
Login
串文
串文鏈結
2024-12-23 23:29
So wait, API keys are to be private right? Then in production, if you're making API calls how does one make sure the keys aren't can't be taken through devtools? I'm prolly just ignorant of a solution
讚
216
回覆
168
轉發
6
作者
Ghøst👻
nueldotdev
粉絲
265
串文
107+
讚
回覆
轉發
24小時粉絲增長
無資料
互動率
(讚 + 回覆 + 轉發) / 粉絲數
147.17%
回覆 (BETA)
最先回覆的內容
發文後
用戶
內容
27 分鐘內
Stephen
elsteve314159
Your backend proxies to the gated API services on the client's behalf. This also allows you to avoid CORS problems. API keys stay nice and secure in key vaults or env variables and your backend can do client validation and authentication before firing off the requests.
一小時內
cage.of.freedom
A web app shouldn't run on the client's machine, it should run on your machine and only serve a bunch of beautiful text to the client
3 小時內
Cole Snyder
dropmeabeat
Generally, associate the keys to a tenant or user. If your system is user-centric and not B2B SAS, use oauth instead of keys. Finally, I always tell my devs to do auth LAST. Most frameworks have OOTB support for auth. By the time you implement it you'll be more familiar with your framework, so it will be easier. Additionally, introducing auth to your project too early will significantly slow your development time due to the extra overhead around having to constantly sign in to do smoke testing.
10 小時內
Gareth Wright
batman3227
I used to wonder why malware is so prevalent…then I read these replies. 🤦♂️
2 天內
Ale
ale.ortegx
you talking about security. Best practice is to boot a back-end and use it as a bridge, at least for third-party APIs. If we are talking about an API you do own, you should learn about auth workflows, e.g OAuth. Also there are other mechanisms such like the one Segment uses, public write-only keys exposed and they secure further through CORS and whitelisting :)