I want to allow users to login with google on a site and collect their name and email address but I can't find any documentation on the userinfo scope for google's api: https://www.googleapis.com/auth/userinfo.
Thanks
This is a better way to get the name and email.
Set your scopes to:
https://www.googleapis.com/auth/userinfo.email
and
https://www.googleapis.com/auth/userinfo.profile
And use the endpoint:
https://www.googleapis.com/oauth2/v1/userinfo?alt=json
That will get you all you need!
I use http://www-opensocial.googleusercontent.com/api/people/ and https://www.googleapis.com/auth/userinfo#email as the scope of the request tokens.
The protected resource url is https://www-opensocial.googleusercontent.com/api/people/@me/@self to get the current user's data.
I get the user's G+ profile and name. I'm not able yet to get the user's email but I think i'm close
Retrieve OAuth userinfo using the Google Python API:
https://developers.google.com/api-client-library/python/start/installation https://developers.google.com/api-client-library/python/guide/aaa_oauth
import httplib2
from apiclient.discovery import build
from oauth2client.client import OAuth2WebServerFlow
http = httplib2.Http()
http = credentials.authorize(http)
users_service = build('oauth2', 'v2', http=http)
user_document = users_service.userinfo().get().execute()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With