On 07/30/2013 12:34 PM, Patrick Ohly wrote:
What I get back is:
Got token :{'Scope': <'email
https://www.googleapis.com/auth/calendar'>,
'AccessToken':
<'ya29.AHES6ZSZTGb6_eBCx6Bz4BoEkwotZBNI_AB3vIidfrxKqphQu1hm5A'>,
'TokenParameters': <@a{sv} {}>, 'TokenType':
<'Bearer'>, 'RefreshToken':
<'1/2RsyUDJnBl1baScVkKN7hZQtlS0yXzaqgmp_hYNszO4'>, 'Duration':
<int64
3600>, 'Timestamp': <int64 1375174956>}
The Google docs
(
https://developers.google.com/accounts/docs/OAuth2Login#obtainuserinfo)
say that I get an "ID token" back from the OAuth2 login and explains
what that token contains. How do I get access to that ID token with
libsignon-glib?
The page above is meant for developers of web services who want to
delegate user logins to Google. The page for device application
developers (that is, for us) is this one:
https://developers.google.com/accounts/docs/OAuth2InstalledApp
(here is more information on various types of clients, how to create
client ids for them and what flows they should be using:
https://developers.google.com/console/help/#generatingoauth2 )
If you need Google's user id and email address associated with an access
token, you can fetch a token and use it with the UserInfo API as
described on the same page - there is even a command line example using
curl:
https://developers.google.com/accounts/docs/OAuth2InstalledApp#callinganapi
We tried it with Amarnath and it returns a JSON string containing
Google's user id and email, and that the email is verified.
Alex