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

docs: get_user_credentials doc to update no longer existing settings. #287

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

C0t300
Copy link

@C0t300 C0t300 commented Jul 11, 2023

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #286

@C0t300 C0t300 requested review from a team as code owners July 11, 2023 16:38
@google-cla
Copy link

google-cla bot commented Jul 11, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@product-auto-label product-auto-label bot added the size: xs Pull request size is extra small. label Jul 11, 2023
@@ -91,10 +91,12 @@ def get_user_credentials(
you've provided.

To obtain the ``client_id`` and ``client_secret``, create an **OAuth
client ID** with application type **Other** from the `Credentials page on
client ID** with application type **Web Application** from the `Credentials page on
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be a Desktop/Installed application type as well.

Maybe just remove the application type part from the comment.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't get it to work with Desktop/Installed Application, that's the main reason I submitted this pr.
Also I think the application type part is useful for newbies like me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the error you are running into for Desktop OAuth Client? I ran the below code and got a refresh token successfully. The client id and secret I used were of a Desktop Client.

import google_auth_oauthlib
from google.auth.transport.requests import Request

# TODO: Create a client ID for your project.
client_id = "<replace with client id>"
client_secret = "<replace with client secret>"
# TODO: Choose the needed scopes for your applications.
scopes = ["https://www.googleapis.com/auth/cloud-platform"]
cred = google_auth_oauthlib.get_user_credentials(
    scopes, client_id, client_secret
)

cred.refresh(Request())
print(cred.refresh_token)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: xs Pull request size is extra small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong Docs in google_auth_oauthlib.get_user_credentials?
2 participants