Created attachment 90152 [details] Patch for UOA support Here's a patch which adds support to Ubuntu Online Accounts. Please notice the change at line 170 in signon.cpp: without that, I couldn't get the code to build. Let me know if that is fine, or if I should remove that chunk or if you prefer to have it submitted as a separate patch.
(In reply to comment #0) > Please notice the change at line 170 in signon.cpp: without that, I couldn't > get the code to build. Let me know if that is fine, or if I should remove > that chunk or if you prefer to have it submitted as a separate patch. I'll submit it separately. It'll potentially pass NULL for the %s which printf tends to catch, I usually just don't want to rely on that. What kind of compiler error did you get with the old code? The rest of the patch looks good, thanks.
One question: do the instructions in the README apply also to UOA? At least one detail would be different: username has to use "uoa:" instead of "gsso:". I wonder whether we should let both backends use the same "signon:" prefix and never allow both of them to be active at the same time (as it is now anyway), to minimize confusion for users.
Which version of libsignon-glib and libaccounts-glib are needed by the code? I tried compiling on Ubuntu Quantal, my current build platform for SyncEvolution binaries for EDS >= 3.6. That passed configure, but then compilation failed due to missing methods (signon_auth_session_process_async/finish, ag_account_set_variant, ...).
Right, I should probably have added the versions to the pkg-config check. Here they are: libaccounts-glib 1.7 libsignon-glib 1.8 As for the build error, here's what I get: =========================================== In file included from /media/mardy/Data/src/git/freedesktop/syncevolution/src/syncevo/util.h:25:0, from /media/mardy/Data/src/git/freedesktop/syncevolution/src/syncevo/IdentityProvider.h:22, from src/backends/signon/signon.cpp:22: src/backends/signon/signon.cpp: In member function 'virtual std::string SyncEvo::SignonAuthProvider::getOAuth2Bearer(int) const': src/backends/signon/signon.cpp:177:46: error: conversion from 'SyncEvo::PlainGStr' to 'bool' is ambiguous buffer ? buffer.get() : "<<null>>", ^ /media/mardy/Data/src/git/freedesktop/syncevolution/src/syncevo/Logging.h:454:43: note: in definition of macro 'SE_LOG' ##_args); ^ src/backends/signon/signon.cpp:176:9: note: in expansion of macro 'SE_LOG_DEBUG' SE_LOG_DEBUG(NULL, "OAuth2 token result: %s, %s", ^ src/backends/signon/signon.cpp:166:19: note: candidates are: PlainGStr buffer(g_variant_print(sessionDataVar, true)); ^ In file included from src/backends/signon/signon.cpp:40:0: /media/mardy/Data/src/git/freedesktop/syncevolution/src/syncevo/GLibSupport.h:624:9: note: SyncEvo::PlainGStr::operator const gchar*() const operator const gchar *() const { return &**this; } ^ In file included from /usr/include/boost/smart_ptr/shared_ptr.hpp:672:0, from /usr/include/boost/shared_ptr.hpp:17, from /media/mardy/Data/src/git/freedesktop/syncevolution/src/syncevo/ThreadSupport.h:33, from /media/mardy/Data/src/git/freedesktop/syncevolution/src/syncevo/Logging.h:36, from /media/mardy/Data/src/git/freedesktop/syncevolution/src/syncevo/util.h:25, from /media/mardy/Data/src/git/freedesktop/syncevolution/src/syncevo/IdentityProvider.h:22, from src/backends/signon/signon.cpp:22: /usr/include/boost/smart_ptr/detail/operator_bool.hpp:52:5: note: boost::shared_ptr<T>::operator boost::shared_ptr<T>::unspecified_bool_type() const [with T = char; boost::shared_ptr<T>::unspecified_bool_type = char* boost::shared_ptr<char>::*; boost::shared_ptr<T>::element_type = char] operator unspecified_bool_type() const BOOST_NOEXCEPT ^ ===========================================
I've pushed a "uoa" branch which contains the patch with separate fixes for the "buffer" compile problem, a compile problem when neither gSSO nor UOA were enabled, and the configure version check. Alberto, can you double-check that this still works? I'm probably not going to include it in 1.3.99.6 because throroughly testing that would delay 1.3.99.6 even further, but can merge shortly afterwards.
Alberto confirmed that the "uoa" branch worked for him, so I merged into master and pushed that.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.