logoalt Hacker News

sandrelloyesterday at 9:25 AM2 repliesview on HN

Since I've never used them, how could API keys for Firebase or Maps be safe for embedding in client side code?

I mean, I get that authentication to the service is performed via other means, but what's the use of the key then?

I'm guessing it's just a matter of binding service invocations to the GCP Project to be billed, by first making sure that the authenticated principal has rights on that project, in order to protect from exfiltration. That would still be a strange use case for what gets called an "API key".


Replies

Ensorceledyesterday at 3:29 PM

> That would still be a strange use case for what gets called an "API key".

The problem that you, and many people are having in this thread, is that you are typing "API key" but, in your head, you're thinking "private API key". API keys can be secret or public, and many services have matching pairs of secret and public keys (Stripe, Chargify, etc. etc. etc.)

evntdrvnyesterday at 2:18 PM

They’re bound to http Referrer iirc