Signing request with only API key
As far as I understood, using a Client ID and a secret is a legacy way to call APIs: https://developers.google.com/maps/premium/authentication/client-id/url-authorization
I would like to call the API and adding a signature using only my API key. For example doing the following:
client = googlemaps.Client(key="<MY-KEY>", client_secret="<MY-SECRET>").
Nonetheless, no signature is added if I don't add a Client ID (which I do not have).
If you would like to upvote the priority of this issue, please comment below or react with :+1: so we can see what is popular when we triage.
@simoroma Thank you for opening this issue. 🙏 Please check out these other resources that might help you get to a resolution in the meantime:
- Check the issue tracker - bugs and feature requests for Google Maps Platform APIs and SDKs
- Open a support case - Get 1:1 support in Cloud Console.
- Discord - chat with other developers
- StackOverflow - use the
google-mapstag
This is an automated message, feel free to ignore.
I managed to do call the API with a key and a signature adding this:
# Add signature
if self.key and self.client_secret:
params.append(("key", self.key))
path = path + "?" + urlencode_params(params)
print("Add signature to Google Maps API call.")
sig = sign_hmac(self.client_secret, path)
return path + "&signature=" + sig
here https://github.com/googlemaps/google-maps-services-python/blob/645e07de5a27c4c858b2c0673f0dd6f23ca62d28/googlemaps/client.py#L401
I can make a new pull request if someone else is interested.