Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google maps API key is exposed #49

Open
kanandam opened this issue Jan 23, 2024 · 4 comments
Open

Google maps API key is exposed #49

kanandam opened this issue Jan 23, 2024 · 4 comments

Comments

@kanandam
Copy link

Hi there,
I'm using this library for geocoding purpose in my react code, and the API key is exposed in the request under query params, is there a way to encrypt or hide it in the request?

image

TIA...

@ziyaddin
Copy link
Collaborator

Hi, it's impossible and it has been a known issue for a long time. Community recommends to create and use a separate API key for each type of operations (e.g. one for geocoding, one for map rendering, etc.) to at least decrease the negative impact of only one key being abused with all types of operations by a malicious user.

@kanandam
Copy link
Author

Hey @ziyaddin , I've been using this other library for google maps component, it uses some methods to create a security layer for the request api, just letting you know if it can help.
https://github.com/JustFly1984/react-google-maps-api/tree/master/packages/react-google-maps-api

cheers...

@Aupire
Copy link

Aupire commented Jan 30, 2024

Hi there, I'm using this library for geocoding purpose in my react code, and the API key is exposed in the request under query params, is there a way to encrypt or hide it in the request?
image

TIA...

Hi,
It's not a problem to expose your api, you simply just restrict your apis from ip address or url website ...
https://cloud.google.com/api-keys/docs/add-restrictions-api-keys

@kanandam
Copy link
Author

kanandam commented Feb 1, 2024

@Aupire yes, I'm aware of restricting the API, but we don't have the access to the GCP to restrict, it's with client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants