The two scopes which can be used to return a user info object are listed under the Google OAuth2 API v2:
https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile You can use either or both depending on what additional user information you want. The API call is a GET request to either of these request URIs: https://www.googleapis.com/oauth2/v2/userinfo https://www.googleapis.com/userinfo/v2/me The response object looks like the following: { "family_name": "Last name", "name": "Display name", "picture": "https://lh6.googleusercontent.com/abc123/photo.jpg", "locale": "en", "email": "[email protected]", "given_name": "First name", "id": "11223344556677889900", "hd": "google.com", "verified_email": true } The OAuth2 flow for a script that doesn't have a web server to handle a callback is done by manually inputting the authorization code in the terminal after the browser flow completes. An example <https://developers.google.com/api-client-library/python/auth/installed-app#example> is given in the documentation for the Google API Python Client Library <https://developers.google.com/api-client-library/python/>. On Saturday, July 23, 2016 at 1:57:57 AM UTC-4, Cameron Blackwood wrote: > > > I have a deployed and working appengine project. > I had a command line python script (using clientlogin) that used to > authenticate as a google user and pull data/reports. > > I have a command line script that can do the oauth2 validation (gives you > a url, you login and paste back in a validation string) but there are so > many scopes and none of them seem to set google appengine's user which > seems to be passed from googles magic front end. User is access via via > google.appengine.api.users.get_current_user() and documented here > https://cloud.google.com/appengine/docs/python/users/ > > I am looking to fix the script to work with oauth2 (as clientlogin is no > longer supported) and I am: > > * is it possible to use oauth2 to set the user *without* fully > implementing oauth2 callbacks in my appengine project (i am just using > google accounts and the user seems to be set before my appengine project > gets called) > > * if so, what is the scope scope needed to set the user variable (there > are quite a few and i have had no luck with the google appengine ones that > seem to me to be relevant https://developers.google.com/oauthplayground/) > > > > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/google-appengine. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/97454c07-aa53-4b5c-bd44-019c61c2c98e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
