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

any plans to add support for https://www.googleapis.com/oauth2/v3/tokeninfo?access_token=TOKEN #1268

Open
davidxia opened this issue Apr 5, 2023 · 2 comments

Comments

@davidxia
Copy link

davidxia commented Apr 5, 2023

Hi, I noticed there's no function to call the https://www.googleapis.com/oauth2/v3/tokeninfo?access_token=TOKEN endpoint. Any plans to do so or are you open to PRs?

I couldn't find any other Google Python library that supports this endpoint. This repo seems like the best fit.

@clundin25
Copy link
Contributor

Hi @davidxia,

Can you expand on your use case? This endpoint is deprecated in favor of https://oauth2.googleapis.com/tokeninfo.

Additionally this endpoint is not recommended for production. Would a tool like https://github.com/google/oauth2l or curl support your use case?

@davidxia
Copy link
Author

davidxia commented Apr 20, 2023

Can you expand on your use case?

I just need to get the associated email from a token right now.

This endpoint is deprecated in favor of https://oauth2.googleapis.com/tokeninfo.

Thanks, wasn't aware. I'll update my code. Is there some doc that states this deprecation?

Additionally this endpoint is not recommended for production.

Thanks, why is https://oauth2.googleapis.com/tokeninfo not recommended for production? My RPS very low like 1 request/hr right now.

Would a tool like https://github.com/google/oauth2l or curl support your use case?

Looks like this is a Golang CLI. I am writing a Python web service that gets a Google OAuth token and needs to get the associated email. My code looks like

import requests
reply = requests.get("https://oauth2.googleapis.com/tokeninfo", params={"access_token": token})
if reply.ok:
    token_info = reply.json()
    token_info["email"]
else:
    raise RuntimeError(
        f"Failed to get token info. Reply status code: {reply.status_code}. Reply message: {reply.text}"
    )

I don't want to shell out to a Go CLI executable. I was hoping this library or some official Google Python library had a binding/method for this endpoint. But it's so simple enough to do on my own that this is a very minor feature request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants