Google Maps API referrer not allowed

I get a RefererNotAllowedMapError error RefererNotAllowedMapError from some PC when loading a page on my site.

RefererNotAllowedMapError

The current URL loading the Google Maps JavaScript API has not been added to the allowed list. Check the referrer for setting your API key in the Google Cloud Console.

See API Keys

It works fine on FireFox from 3 out of four tested machines.

Typically, this means that the domain is not added as a referent in my API console, but it is definitely, and it definitely works on other machines.

Has anyone else had this problem or could it provide some responsibility?

+16
javascript google-maps
Sep 16 '15 at 5:19
source share
9 answers

Re-creating the API key in console.developers.google.com fixed the problem for me.

+17
Sep 19 '15 at 5:55
source share

Try adding all types of URLs, for example:

 http://stackoverflow.com/* http://www.stackoverflow.com/* *.stackoverflow.com/* 

It will definitely work.

+9
Sep 19 '16 at 11:59
source share

To use the Places API , I had to turn on the Maps JavaScript API

+2
Aug 27 '19 at 11:15
source share

This gives an error because your Google Map API key is not a browser key. Create a new key as a "browser key". This option is available when creating a new key.

+1
Mar 21 '16 at 10:53 on
source share

I had a similar problem when I tried to use the API, but was limited only to the Map product. It generated the same error even if there was nothing in the http referrer field (open to everyone). The problem disappeared after re-creating the new key without any product restrictions.

+1
Apr 18 '18 at 19:05
source share

Pay attention to the DOT at the beginning of the expression, this is a symbol!

*.stackoverflow.com/* // this will not work with http://stackoverflow.com

You will also need to add:

*://stackoverflow.com/* // now it will cover all domain options

0
Jan 04 '18 at 4:27
source share

Creating a new browser key fixed this for me. https://console.developers.google.com/projectselector/apis/credentials

Error RefererNotAllowedMapError The current URL loading the Google Maps API JavaScript has not been added to the list of allowed referrers. Check the referrer settings of your API key on the Google API Console.

See API keys in the Google APIs console. For more information, see Best Practices for Safely Using API Keys.

0
Jan 05 '18 at 6:56
source share

The only thing that worked for me was to create a new key without restrictions, including without API restrictions.

This will not be a working solution in a production environment, but it will allow us to move forward with development.

0
Sep 26 '18 at 21:25
source share

The solution to each / such Maps Javascript API error varies for different scenarios for different developers. A list of errors with a detailed description is given by Google here.

However, please refer to the screenshot below: Maps Javascript API restrictions

  1. As you can see above in the Application restrictions section, simply selecting HTTP referrers will fail. You must add a URL (i.e. the URL of the website from which the API will be called to display the map).
  2. Now the exact page (in my case the contact page with us) that is going to make an API request should be specified in the URL, and not just in the domain.
  3. Please see the examples in the documentation on the right.
  4. Adding /* after the domain URL, for example, http://www.telesuprecon.com/* , will make the request possible from any page on your site.
0
Sep 18 '19 at 13:14
source share



All Articles