Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Hello I have problem about restriction api key google, and the problem :
- first I use the key restriction with
- "HTTP referrers (web sites)"
- like :
- 1. mydomain.com/*
- 2. star.mydomain.com/star (star *)
- and when I use api geocode with that restriction it's resulting:
- > "API keys with referer restrictions cannot be used with this API."
- and I search the solution I got from this link:
- https://stackoverflow.com/questions/42167695/api-key-browser-api-keys-cannot-have-referer-restrictions-when-used-with-this-ap
- it's said from a person:
- > "You can change your restriction from a browser restriction to a
- > server restriction by using IP addresses to restrict access, instead
- > of browser referrers."
- so I change restrictions from "HTTP referrers (web sites)" to "IP addresses (web servers, cron jobs, etc.)"
- And resulting this:
- > "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://m.mydomain.id/"
- and I search the solution I got from this link:
- https://stackoverflow.com/questions/21933247/this-ip-site-or-mobile-application-is-not-authorized-to-use-this-api-key
- and it's said by mike20132013 "it requires the server key". And the other person said "There is no such thing as "Server Key" anymore."
- the other person commnet as:
- > "Include HTTP header "Referer:yourdomain.com" and this should fix the
- > response issues."
- > like Here's what I did, and it worked perfectly: var options = { url:
- > url, headers:{ Referer:'xxx.herokuapp.com' } }; request.get(options,
- > function(...
- I'm using react-geocode and I don't know to do it
- and I still confuse to resolve this issue from the second link, can somebody tell me the detail and up to date about this issue???
- the other solution is use restrictions as none, but i won't do that.
- other link's but still nothing:
- 1. https://stackoverflow.com/questions/23872909/this-site-or-ip-is-not-authorized-to-use-this-api-key
- take a look this, I had do like this
- https://stackblitz.com/edit/react-5bsr3p
- Thanks for your help....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement