On Mon, 2013-07-29 at 19:25 +0300, Alexander Kanavin wrote:
On 07/29/2013 04:40 PM, Amarnath Valluri wrote:
> Yes, It worked for me :
> -----------------------------
> ~/work/code.google.com/libgsignon-glib/examples$ ./google-oauth2-example
> --get-google-token=5
> --client-id="796629365126.apps.googleusercontent.com"
> --client-secret="3NbR94RM-DTnA81BWjiJe4TP"
> Geting token
> Got token :{'AccessToken':
> <'ya29.AHES6ZS7RpdHAoikzv0ZdV-2xpPDUXMJkFCcaNpz6r3_G5k'>,
> 'TokenParameters': <@a{sv} {}>, 'TokenType':
<'Bearer'>, 'Duration':
> <int64 3596>, 'Timestamp': <int64 1375105096>, 'Scope':
> <'https://www.googleapis.com/auth/calendar'>}
It's a bit odd that there is no refresh token. I've added HTTP traffic
debugging to the plugin, so we can see what is exactly being sent and
received.
I get a RefreshToken, but miss some other information: I am not getting
information about the current user when using "Scope" =
g_variant_new_string ("email
https://www.googleapis.com/auth/calendar").
The Google login page correctly shows that the client is asking for
email address and "who I am on Google" in addition to calendar access,
so the scope above is right.
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?
I am not sure yet whether I'll need that piece of information. In the
past, it was necessary for Google CalDAV because auto-discovery of the
right URL was basically broken in the Google server. Perhaps it works
now with the new entry URL, I need to check.
--
Best Regards, Patrick Ohly
The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.