Skip Navigation

[Résolu] Server Side Google Maps API Key

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:
When setting up a second Google API key for server side requests, what kind of API key should it be (in the Google settings), a normal API key or a "Service account key" for server-to-server requests?

Solution:
A normal API key.

The intention is that you create the main API key with URL referrer restrictions for your site (for exposed front-end requests) and the second key with no such restrictions which we will use for the unexposed server-based requests.

If your site has a fixed IP address you could add IP-based restrictions to the second key.

Relevant Documentation:
https://toolset.com/documentation/user-guides/display-on-google-maps/creating-a-google-maps-api-key/

This support ticket is created Il y a 6 années et 4 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par julieP Il y a 6 années et 4 mois.

Assisté par: Nigel.

Auteur
Publications
#957092
create credentials.JPG

Google won't let me set any restrictions on my Google Maps API key so I'm looking at using the second key you incorporated into the latest version of Maps but I'm not sure how to do it.

When I'm in the maps console and select 'create credentials' I get a dropdown with 3 choices (see image). Do I simply create another API key (i.e. choice #1) or a service account key (choice #3)?

Thanks

#957134

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+00:00)

Hi Julie

Your second API key should be a normal API key.

The intention is that you create the main API key with URL referrer restrictions for your site (for exposed front-end requests) and the second key with no such restrictions which we will use for the unexposed server-based requests.

If your site has a fixed IP address you could add IP-based restrictions to the second key.

#957149

Thanks Nigel; that seems to be working OK.

It's strange that when I only had one key, Google wouldn't let me add any referrer restrictions but once I added a second one, I could (???).

Bye for now