question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Weird API keys being used for geolocation queries

See original GitHub issue

In the geolocation demo https://tomchentw.github.io/react-google-maps/basics/geolocation the API key defined in the app is: AIzaSyC4R6AN7SmujjPUIGKdyao2Kqitzr1kiRg However, the actual requests are sent with a different keys, depending on the browser: Chrome: AIzaSyBOti4mM-6x9WDnZIjIeyEU21OpBXqWBgw Firefox: AIzaSyD_Drzahe4dBzGCZ9ArvowCvrPx_yFrlCM, e.g.: POST /geolocation/v1/geolocate?key=AIzaSyBOti4mM-6x9WDnZIjIeyEU21OpBXqWBgw

If I understand correctly, these are some kind of generic browser keys, however, the problem is that they hit the daily usage limits in the in the later hours of the day.

How can I force the library to use my own key for the geolocation requests?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

1reaction
oshalygincommented, Jul 27, 2017

I see what you’re saying, I’ll let others comment but as far as I can tell the library is just using the HTML5 geolocation API to find your location, from there its just a matter of using the google maps library to center or place a marker at that location. There’s no explicit calls out to /geolocation/v1/etc. The browser might be doing that internally in how it works, but iirc there’s no way to configure this.

I could be wrong, leaving this open to see if anyone else has come across this.

1reaction
asliwinskicommented, Jul 27, 2017

@oshalygin I’m afraid you did not understand my point. Whichever key I am using, the geolocation requests are always fired with the keys I mentioned. You can reproduce it even on the Google Developer’s site: https://developers.google.com/maps/documentation/javascript/examples/map-geolocation The request that is being sent to the api: POST /geolocation/v1/geolocate?key=AIzaSyBOti4mM-6x9WDnZIjIeyEU21OpBXqWBgw HTTP/1.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get geolocation api keys without anything
I am currently looking into the geolocation API from google/mozillas MLS geolocation. I am unable to enter any payment information for google ...
Read more >
Use API Keys with Geolocation API - Google Developers
Restricting API keys · Go to the Google Maps Platform > Credentials page. Go to the Credentials page · Select the API key...
Read more >
Security best practices - Algolia
Learn about API keys, ACL, HTTP requests, and security policies you need to know to ensure the security of your data hosted by...
Read more >
Cloudflare API v4 Documentation
Example: a Cloudflare Certified Hosting Partner may use APIs to toggle basic security ... To purge files with ${geo} or ${devicetype} in their...
Read more >
Securely using API keys in Postman
Sending an API key in the query string as part of the URL is a common practice. Go to the NASA API portal,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found