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

[Question] What other OAuth2 scopes can I access apart from the API scopes #1089

Closed
arnitdo opened this issue Nov 12, 2020 · 4 comments · Fixed by #1090
Closed

[Question] What other OAuth2 scopes can I access apart from the API scopes #1089

arnitdo opened this issue Nov 12, 2020 · 4 comments · Fixed by #1090
Assignees
Labels
good first issue This issue is a good place to started contributing to this repository. type: question Request for information or clarification. Not an issue.

Comments

@arnitdo
Copy link
Contributor

arnitdo commented Nov 12, 2020

In some sample code snippets, the OAuth2 scope has been set to something like ["user, "profile"].

For example, the sample code snippet has scopes ["profile", "email"].

Is there any documentation about non API OAuth scopes like mentioned above?

@parthea parthea added the type: question Request for information or clarification. Not an issue. label Nov 12, 2020
@parthea parthea self-assigned this Nov 12, 2020
@parthea
Copy link
Contributor

parthea commented Nov 12, 2020

Great question! In the Getting Started guide, we have a link in section 2 Authorized API access (OAuth 2.0) that points to the OAuth2 page. From there you can click on OAuth 2.0 Scopes.

It would probably be helpful to have some text with a link under the Scopes bullet point in section 2 Authorized API access (OAuth 2.0) that directs the user on where to find the OAuth 2.0 Scopes. Are you by any chance interested in opening a pull request to improve getting started guide doc?

@parthea parthea added the good first issue This issue is a good place to started contributing to this repository. label Nov 12, 2020
@arnitdo
Copy link
Contributor Author

arnitdo commented Nov 12, 2020

Sure! I've opened PR #1090 .

One side question -

It seems that the ["profile", "email"] scope I was referring to is part of the Google OAuth2 API v2 -
i.e "profile" refers to userinfo.profile, and "email" refers to userinfo.email

My question is, how do i access this information from a built API service, and what service name do i use?

@arnitdo
Copy link
Contributor Author

arnitdo commented Nov 12, 2020

Ah! After some digging around, I've found this SO Question, and the first answer seems to use serviceName "oauth2" and access user information using further functions.

The "oauth2" service name is not seen on this page. I'm assuming that it has been deprecated, or is no longer available from google-api-python-client.

@arnitdo
Copy link
Contributor Author

arnitdo commented Nov 12, 2020

Sorry for the long wall of replies.
After some more digging around, I've found #1088 and #1071 , and that has answered all my questions! :-D

I've also found out that one can get user information from the peoples API!

Thank you very much!

gcf-merge-on-green bot pushed a commit that referenced this issue Nov 13, 2020
Add available scopes link in start.md --> Authentication Section 2 (Authorized API Access)

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:
- [x] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/google-api-python-client/issues/new/choose) before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)

Fixes #1089 🦕
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue This issue is a good place to started contributing to this repository. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants