My site still haven't domain and I typed just "localhost" in field where site specified. And I've got answer "The Google Maps API server rejected your request. The provided API key is invalid.".
The same problem when I chose "service account" and "installed application".
Actually, I don't know what to chose, I have now just html files, and try to paste Google Map in one of them. But nothing works whatever application type I chose.
P. S. Sorry, I forgot to say that I use Embed API.
Don't specify any referer, leave the field empty(or don't use a key until you move to a domain)
Related
I just setup Google PageSpeed Insight into my Google Webmaster but whenever I am trying to do PageSpeed Test this error occurs "The referrer https://www.googleapis.com/ does not match the referrer restrictions configured on your API key. Please use the API Console to update your key restrictions."
I already created API for my URL and Created Restriction of HTTPS Referrers and submitted my Website in it but still not working.
Any solution for it?
You have set your restrictions incorrectly, the error message points you directly to the problem.
Remove all restrictions and try again, then slowly add restrictions until you reach the problem.
If you have restricted Accept requests from these HTTP referrers (web sites) (Optional) then bear in mind you have to verify your site first for some APIs to function correctly.
I'm using a Google API (e.g., for Maps Embed) with a key that is restricted via a list of HTTP Referrers. In this case, the map is embedded in my.site.com, so within the Google API -> Credentials page, I allow access for referrer .site.com/. When I visit my.site.com from most browsers, Google maps displays correctly as the browser sets the referrer field to my.site.com. When using the Brave browser, however, it sets the referrer field to the origin and displays an error:
Request received from IP address 98.229.177.122, with referrer: https://www.google.com/
Of course I could add google.com to the list of allowed referrers, but that defeats the purpose of limiting the use of the API key to my own website - anyone could "borrow" the API key, add it to their site for the same API, and anyone using Brave would be able to access the feature. Now that each access costs $, I'd rather not do this. Any ideas for a work-around?
Note: #geocodezip - thanks for the reference. Indeed, I forgot to add that when I set the site-specific shield to "All cookies allowed", or even completely turn shields off for the site, the behavior is still the same (error). However, in the default shield settings, when I set the cookies field to "All cookies allowed", then it works as intended (maps are displayed), even though for the default settings section it states:
These are the default Shields settings. They apply to all websites
unless you change something in the Shields panel on a particular site.
Changing these won't affect your existing per-site settings.
which I interpret to mean that the site-specific settings take precedence over the defaults.
So I'm thinking this (site-specific cookies setting not over-riding the default) is a brave bug, though that is a bit separate from my initial hope for a different approach that didn't require manual intervention on the user's part.
<iframe width="100%" height="427" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/place?q=place_id:[place_id]&key=[my_key]" allowfullscreen></iframe>
"Google Maps Platform rejected your request. This IP, site or mobile application is not authorized to use this API key. Request received from IP address xxx.xxx.xxx.xxx, with referer: https://xxx.xxx/"
In Google Dev I have enabled Maps Embed API and also Maps Static API. I have limited the key to work with my domain only, where the above code is included, like https://[asterisk].thedomain.com/[asterisk].
The map embed works and does not throw an error, when I do NOT limit the key to this single domain.
The issue is, that the key is plain readable in the code and thus I need to limit the key to my domain.
Any ideas?
Thank you.
My site in question is delivered like https://thedomain.com/.
Google Maps Platform does make a difference between https://www.thedomain.com/ and https://thedomain.com/.
Limiting my API to https://thedomain.com/* worked for me, while https://*.thedomain.com/* does not imply * to be nothing.
Make sure you have "Maps Embeded API" added to the key restrictions / api restriction section of the API Key you are using.
If you check the example google gives, it as an error in it. It should be : http://*example.com/* and NOT http://*.example.com/* because of the dot it won't work if you don't have something before your domain name like www.
http://example.com won't work simply because it doesn't have a . between // and example.
I'm no stranger to Google Maps APi, and have used it for years...but I am stumped. I've installed an exact copy of the latest code sample from Google Maps Javascript API: Simple Map. I then confirmed both my browser and server keys from Google Developers Console, added the refer two different ways(see below). Code works when I set the referer to * wildcard in console, but cannot use that in production.
Here's the skinny:
tested using latest example code from Google Maps API Javascript (Simple Map)
YOURAPIKEYHERE - replaced with an active browser key from my account
referer was tried as both *./domain.ext/* and domain.ext/*
Also tried a server key, with server IP as allowed referer.
CANNOT USE, BUT WORKED : used a wildcard for allowed referer using browser key, but I can't use that in production...anyone could use my key on my dime
SUSPECTED CULPRIT
Since the key works when I add a wildcard, but not with the referer domain name, it seems suspicious. This should indicate that the key works, but that the referer information is not getting passed to Google.
My site is behind CloudFlare. My research is not finding any answers anywhere, but I'm beginning to wonder if this could be the issue. Nothing else seems to work.
SOLUTION:
The google console specifically shows the format for this. But it is WRONG.
Instead of *./domain.ext/*
use: http://domain.ext/*
A special thanks to Google for crappy docs, and a very special thanks to the user that downvoted my question!
Note: Depending on your setup, it may be necessary to use: http://www.domain.ext/*
I did not test this as my use case excludes www.
I know you found a misconfiguration in your API key but I had the same issue and found a different fix.
Cloudflare can mess this up. Testing with mine now shows rocket loader and Brotli in the speed area stop google maps working. Deactivate them and clear the cache to fix.
I had error when access SharePoint sites out of the server , as when I
try to add new document or did any action this error displayed although
it worked well in SharePoint server
I think Yevgeniy made a good suggestion.
I assume you mean by 'outside' the server, users are trying to view the page on a different URL? If so, it might be the URLs to access the site 'outside SharePoint' are not configured correctly.
I would suggest a few things to start with:
When you say it works 'in SharePoint server' does this mean that the whole site is accessible, with no problems? But using a different URL (i.e. host header?), fails - for just this one page with the list or the whole site?
Check you have Alternate Access Mappings configured correctly as suggested above - check that the URL is setup correctly in any AAM zones defined, and that the authentication (e.g. Anonymous, Forms whatever required) is also setup too. This is all done in Central Administration.
If AAM setup correctly, check if you have any firewall or other network security that may block access to the site (again, assuming users are routed externally?)
Does the problem page or list (or the subsite it is within) have any unique security permissions?
You can check for the site via Site Actions | Site Permissions - if it does not have unique permissions, you will see a 'This Web site inherits permissions from its parent.' message.
If the List has unique permissions, you can check by going to the list page, and clicking 'Library Permissions' on the Library grouping on the Library Tools section of the ribbon.