On Thu, 2013-07-25 at 09:47 +0000, Valluri, Amarnath wrote:
Please use oauth2 example in libgsignon-glib - examples branch, which
is the complete working example.
Usage:
./google-oauth2-example --create-identity="some_caption"
--identity-method="oauth"
./google-oauth2-example --get-google-token=<<identity_id_returned_above>>
--cilent-id=<<client_id_given_by_google>>
--client-secret=<<client_secret_from_google>>
It should popup the SignonUI where you can enter your google
credentials, then if everything goes well that should fetch tokens
from google.
I tried it using the latest gsignond(devel), libgsignon-glib(examples),
signonui-gtk and gsignond-plugin-oa from this morning.
I can create and query identities, but getting the token fails. It
hangs with "Geting token" (yes, there is a typo in the message ;-)
without popping up a UI dialog.
I know that it talks to the GTK UI, because if I try the example without
gsignon-ui running, I get an error from gsignond immediately:
(gsignond:28739): gsignond-WARNING **:
87679.089922
/home/pohly/src/accounts-sso/accounts-sso.gsignond/src/daemon/dbus/gsignond-dbus-signonui-adapter.c:182
_setup_ui_connection Failed to get signon ui bus address :
GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name
com.google.code.AccountsSSO.gSingleSignOn.UI was not provided by any .service files
(gsignond:28739): gsignond-WARNING **:
87679.090017
/home/pohly/src/accounts-sso/accounts-sso.gsignond/src/daemon/dbus/gsignond-dbus-signonui-adapter.c:258
gsignond_dbus_signonui_adapter_query_dialog assert (!adapter
||!GSIGNOND_IS_DBUS_SIGNONUI_ADAPTER (adapter)) failed
That is as expected, in my installation D-Bus auto-activation of these
services does not work. However, it is unexpected that the example keeps
running in this particular error scenario. Shouldn't it abort the
attempt to get the token and display some kind of error?
When I have signonui-gtk running when trying the command, that error
message does not show up, but there's no visible progress either.
signonui-gtk then quits fairly quickly, as it always does when starting
it manually. May I suggest adding a "--keep-running" option to simplify
manual debugging?
Speaking of terminating, I noticed that the GUI works if I start
gsignond, then signonui-gtk and the example before that signonui-gtk
instance terminates. After restarting signonui-gtk, it no longer works
until I also restart gsignond. If I had to guess, then I would say
gsignond does not properly handle restarting the UI.
So how do I debug gsignond and its interaction with the various
components?
I saw with dbus-monitor that
com.google.code.AccountsSSO.gSingleSignOn.UI is claimed by signonui-gtk
on the session bus, but I don't see any method calls to that service
even when it works.
When the GUI pops up, I can log in. But Google rejects to grant the
token. When using client ID/secret from Evolution (as pointed out before
in this mail thread, those are publicly visible in
https://git.gnome.org/browse/evolution-data-server/tree/modules/ubuntu-on...)
I get an error about the redirect URI "http://localhost" that is used by the
example.
When using my own client ID/secret for an app for which I have enabled
the CalDAV API, I get an error about the scope "email" hard-coded in the
example. Not surprising. So, which Google API do I need to enable for
the example? I looked for "GMail" or "mail", but that is not
currently
offered to me.
What scope do I need to use for CalDAV or CardDAV? I have not found that
in the Google API docs. Does anyone know where it is documented?
https://developers.google.com/google-apps/carddav/
https://developers.google.com/google-apps/calendar/caldav/v2/guide
https://developers.google.com/accounts/docs/OAuth2
--
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.