Create Google API key on Laravel homestead - google-maps

I'm developing my application using Laravel Homestead virtual server. Of course I've rewrite my site from http://192.168.0... to http://myaplication.app. Then I need to create a Google Api key to implement Google maps on my project but I can not generate my api key.
This is how I am doing that:
But Google throws me an error telling me the application is not authorized. Can someone help me?

This is because Google need a regular domain like app.com for "URIS de redireccionamiento". Google doesn't allow local Ip's (e.g. 192.168...).

The solution is simple, because you are in development you have to add http://localhost in Javacript origins and leave blank other form fields where Google asks for ips or URls.

Related

How to use Google Apps Script setAuthentication?

So, I created an script on google sheets that, basically, selects a set of addresses on a sheet and uses Maps.newGeocoder.geocode() to get geocodes and calculate distances. It works wonderfully, no problems there. However, when I try to authenticate using Maps.setAuthentication(clientId, signingKey);, I just get an error.
I got my credentials from loging into https://console.cloud.google.com/, creating a random project and by going in "Create credentials". When I go into the credentials tab, I can select OAuth2.0 and see clientId and client secret key. I am using these to authenticate. Is it correct? What am I doing wrong? How the hell can I get the credentials? Thanks a lot!
The setAuthentication(clientId, signingKey) method enables the use of an externally established Google Maps APIs Premium Plan account, to leverage additional quota allowances. Your client ID and signing key can be obtained from the Google Enterprise Support Portal.
They are not the same as client ID and client secret key as explained here.
Note that this type of account is not longer available for new customers.
Here some helpful links:
Premium Plan Support
Premium Plan FAQ

Get pictures from google drive api with javascript

I have one question, as mentioned
here I'm doing a jQuery/Javascript only homepage.
Now I'm trying to get the pictures from a google drive with the google drive API. The authentication with 0Auth worked very well.
But I'm not sure if it's the right way, because the authentication confused me a little bit.
Here in Step 2 I have to use my Client ID and login with my user, does this mean the Website is now verified to use the API or does this mean everybody who wants to see the pictures has to login?
What happens if the key is not valid anymore or how often do i have to renew it?
Thanks for your help
Before you can integrate Google Sign-In into your website, you must have a Google API Console project. In the project, you create a client ID, which you need to call the sign-in API.
AFAIK, client ID doesn't expire, only access tokens which expire after 60 minutes. If you have a refresh token you can use the refresh token to get a new (valid) access token.
Here's some references which might help:
Google Drive API using Javascript
How to use Google Drive API to download files with Javascript

How to register Google Maps API key for a client's domain I don't own?

I have a website I developed for a client. One of the pages displays a list of street addresses, for which I also have LAT/LONG data. The client requested to add a little map next to this list with a marker for each address.
I would like to use Google Maps API v3, but I have a problem registering client's internet facing URL, which has a form of "ip address:port" (i.e. something like http://123.45.67.89:555) and which I - naturally - do not own and do not have domain admin access. Likewise, their domain admin - whoever s/he is - does not and will not have access to my Google API project for which I'm trying to register the key.
So far I was able to register the client id for local development in a form of http://localhost:5555, but when I'm trying to add the client's URL I'm getting an error
OAuth 2 redirect URL "http://123.45.67.89:555" is invalid.
I searched for solution for this problem and found a suggestion to whitelist the URL in the Google API Console. Yet when I'm trying to add this URL to approved domain list ("notification endpoints") I'm only getting another error:
You do not have access to the following domain:
http://123.45.67.89:555
which is, of course, true. The documentation also says I cannot register a domain I don't own.
So, my question is: how do I register a Client ID for Google Maps API V3 for the client's URL to which I don't have domain admin privileges and whose domain admin doesn't have access to my API project?
Thank you!
Nikolai
You can create a view of the table (File | Create View ...) and own the view (https://support.google.com/fusiontables/answer/171206?hl=en) - thus enabling you to have your own version of the table which is in sync with changes.
As a footnote remember to deal with Cross Origin Resource Sharing (CORS) in your API project by using JSONP for example (https://developers.google.com/storage/docs/cross-origin).
If your are using Google Maps API v3, there is no need to use Google API Key. Simply use below script.
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>

how to test google places apis in localhost and getting the client id

I want to use the places api for getting the places names within a circle in localhost. Does anyone know how to get the client id for localhost?
I'm using Visual Studio and when I debug locally the URL is:
http://localhost:2386/index.html
To connect to Google API I set the following two properties of the Client Id in the API Access tab of the Google API console:
Redirect URIs: http://localhost:2386/oauth2callback
JavaScript origins: http://localhost:2386
I'm using the Analytics API but hopefully this will help in your case as well.
I am not sure if this is what you are looking for but a possible workaround could be:
Get to know the IP of your computer (e.g.: http://whatismyipaddress.com/)
Add your IP in this Format (http://xx.xx.xxx.xx/) to the Google Console (https://developers.google.com/console/)
Use the API-Key for testing.
Be sure that your IP doesn't change :)

problem with gmap valid key

My google map works on local host perfect, but when i get key from codes.google for my server ip my google map alerts your browser does not support google map
i dont know what is my problem can anybody help me?
Try to get a the key for the full domain name (including subdomain), not the IP address.
You can't use your ip address to get an API key.
Also, you don't need to use your full domain name. If you get an API key for 'example.com' - all of the sub-domains and directories on example.com will also be valid.
The problem is not solved yet but i think that it is important to say that when download java script from google from address
http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAmfxEy26bISZt8fzqRClItBRc5N-P1NpY03Egq3jSesNMkYFHpRQxlBgZQE1fKa5udtRsjyL77M61mw
GValidateKey("") is in java script but i find in the web that it contains a key