Skip Navigation

[Resolved] Server Side Google Maps API Key

This thread is resolved. Here is a description of the problem and solution.

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 6 years, 3 months ago. 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.

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)

This topic contains 2 replies, has 2 voices.

Last updated by julieP 6 years, 3 months ago.

Assisted by: Nigel.

Author
Posts
#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

Languages: English (English ) Spanish (Español )

Timezone: 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