Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signing request with only API key #494

Open
simoroma opened this issue Jun 30, 2023 · 2 comments
Open

Signing request with only API key #494

simoroma opened this issue Jun 30, 2023 · 2 comments
Assignees
Labels
triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@simoroma
Copy link

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).

@simoroma simoroma added triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Jun 30, 2023
@wangela
Copy link
Member

wangela commented Jun 30, 2023

If you would like to upvote the priority of this issue, please comment below or react with 👍 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:

This is an automated message, feel free to ignore.

@simoroma
Copy link
Author

simoroma commented Jul 4, 2023

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

I can make a new pull request if someone else is interested.

thkodin referenced this issue in thkodin/signed-googlemaps Aug 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

2 participants