diff -Nru account-plugins-0.12+16.04.20160126/configure.ac account-plugins-0.13+16.04.20160719/configure.ac
--- account-plugins-0.12+16.04.20160126/configure.ac 2016-01-26 10:52:34.000000000 +0000
+++ account-plugins-0.13+16.04.20160719/configure.ac 2016-07-19 13:27:44.000000000 +0000
@@ -41,7 +41,10 @@
[have_libaccount_plugin=no])
AS_IF([test "x$have_libaccount_plugin" = "xyes"],
- [PKG_CHECK_MODULES([ACCOUNT_PLUGINS], [account-plugin >= 0.1.3])],
+ [
+ PKG_CHECK_MODULES([ACCOUNT_PLUGINS], [account-plugin >= 0.1.3])
+ PKG_CHECK_MODULES([RESTAPIS], [libsoup-2.4 json-glib-1.0])
+ ],
[AS_IF([test "x$enable_libaccount_plugin" = "xyes"],
[AC_MSG_ERROR([libaccount-plugin support enabled but required dependencies were not found])])])
diff -Nru account-plugins-0.12+16.04.20160126/data/providers/facebook.provider.in.in account-plugins-0.13+16.04.20160719/data/providers/facebook.provider.in.in
--- account-plugins-0.12+16.04.20160126/data/providers/facebook.provider.in.in 2016-01-26 10:52:34.000000000 +0000
+++ account-plugins-0.13+16.04.20160719/data/providers/facebook.provider.in.in 2016-07-19 13:27:44.000000000 +0000
@@ -4,7 +4,7 @@
facebook
account-plugins
.*facebook\.com
- generic-oauth
+ facebook
true
diff -Nru account-plugins-0.12+16.04.20160126/data/providers/flickr.provider.in.in account-plugins-0.13+16.04.20160719/data/providers/flickr.provider.in.in
--- account-plugins-0.12+16.04.20160126/data/providers/flickr.provider.in.in 2016-01-26 10:52:34.000000000 +0000
+++ account-plugins-0.13+16.04.20160719/data/providers/flickr.provider.in.in 2016-07-19 13:27:44.000000000 +0000
@@ -4,7 +4,7 @@
flickr
account-plugins
.*flickr\.com
- generic-oauth
+ flickr
diff -Nru account-plugins-0.12+16.04.20160126/data/providers/twitter.provider.in.in account-plugins-0.13+16.04.20160719/data/providers/twitter.provider.in.in
--- account-plugins-0.12+16.04.20160126/data/providers/twitter.provider.in.in 2016-01-26 10:52:34.000000000 +0000
+++ account-plugins-0.13+16.04.20160719/data/providers/twitter.provider.in.in 2016-07-19 13:27:44.000000000 +0000
@@ -3,7 +3,7 @@
Twitter
twitter
account-plugins
- generic-oauth
+ twitter
.*twitter\.com
diff -Nru account-plugins-0.12+16.04.20160126/data/webkit-options/api.twitter.com.conf account-plugins-0.13+16.04.20160719/data/webkit-options/api.twitter.com.conf
--- account-plugins-0.12+16.04.20160126/data/webkit-options/api.twitter.com.conf 2016-01-26 10:52:34.000000000 +0000
+++ account-plugins-0.13+16.04.20160719/data/webkit-options/api.twitter.com.conf 1970-01-01 00:00:00.000000000 +0000
@@ -1,2 +0,0 @@
-UsernameField = input[id="username_or_email"]
-PasswordField = input[id="password"]
diff -Nru account-plugins-0.12+16.04.20160126/data/webkit-options/login.yahoo.com.conf account-plugins-0.13+16.04.20160719/data/webkit-options/login.yahoo.com.conf
--- account-plugins-0.12+16.04.20160126/data/webkit-options/login.yahoo.com.conf 2016-01-26 10:52:34.000000000 +0000
+++ account-plugins-0.13+16.04.20160719/data/webkit-options/login.yahoo.com.conf 1970-01-01 00:00:00.000000000 +0000
@@ -1,2 +0,0 @@
-UsernameField = input[name="login"]
-PasswordField = input[name="passwd"]
diff -Nru account-plugins-0.12+16.04.20160126/data/webkit-options/www.facebook.com.conf account-plugins-0.13+16.04.20160719/data/webkit-options/www.facebook.com.conf
--- account-plugins-0.12+16.04.20160126/data/webkit-options/www.facebook.com.conf 2016-01-26 10:52:34.000000000 +0000
+++ account-plugins-0.13+16.04.20160719/data/webkit-options/www.facebook.com.conf 1970-01-01 00:00:00.000000000 +0000
@@ -1,7 +0,0 @@
-ViewportWidth = 420
-ViewportHeight = 320
-UsernameField = input[name="email"]
-PasswordField = input[name="pass"]
-#ZoomFactor = 2
-#PreferredWidth = 420
-
diff -Nru account-plugins-0.12+16.04.20160126/debian/account-plugin-facebook.install account-plugins-0.13+16.04.20160719/debian/account-plugin-facebook.install
--- account-plugins-0.12+16.04.20160126/debian/account-plugin-facebook.install 2016-08-25 07:21:18.000000000 +0000
+++ account-plugins-0.13+16.04.20160719/debian/account-plugin-facebook.install 2016-08-25 07:21:18.000000000 +0000
@@ -1,4 +1,3 @@
-etc/signon-ui/webkit-options.d/www.facebook.com.conf
usr/share/accounts/services/facebook-sharing.service
usr/share/accounts/services/facebook-microblog.service
usr/share/accounts/providers/facebook.provider
diff -Nru account-plugins-0.12+16.04.20160126/debian/account-plugin-flickr.install account-plugins-0.13+16.04.20160719/debian/account-plugin-flickr.install
--- account-plugins-0.12+16.04.20160126/debian/account-plugin-flickr.install 2016-08-25 07:21:18.000000000 +0000
+++ account-plugins-0.13+16.04.20160719/debian/account-plugin-flickr.install 2016-08-25 07:21:18.000000000 +0000
@@ -1,4 +1,3 @@
-etc/signon-ui/webkit-options.d/login.yahoo.com.conf
usr/share/accounts/services/flickr-*.service
usr/share/accounts/providers/flickr.provider
usr/share/accounts/qml-plugins/flickr/Main.qml
diff -Nru account-plugins-0.12+16.04.20160126/debian/account-plugin-twitter.install account-plugins-0.13+16.04.20160719/debian/account-plugin-twitter.install
--- account-plugins-0.12+16.04.20160126/debian/account-plugin-twitter.install 2016-08-25 07:21:18.000000000 +0000
+++ account-plugins-0.13+16.04.20160719/debian/account-plugin-twitter.install 2016-08-25 07:21:18.000000000 +0000
@@ -1,4 +1,3 @@
-etc/signon-ui/webkit-options.d/api.twitter.com.conf
usr/share/accounts/services/twitter-microblog.service
usr/share/accounts/providers/twitter.provider
usr/share/accounts/qml-plugins/twitter/Main.qml
diff -Nru account-plugins-0.12+16.04.20160126/debian/changelog account-plugins-0.13+16.04.20160719/debian/changelog
--- account-plugins-0.12+16.04.20160126/debian/changelog 2016-08-25 07:21:18.000000000 +0000
+++ account-plugins-0.13+16.04.20160719/debian/changelog 2016-08-25 07:21:18.000000000 +0000
@@ -1,3 +1,19 @@
+account-plugins (0.13+16.04.20160719-0ubuntu1) xenial; urgency=medium
+
+ [ Alberto Mardegan ]
+ * After the authentication, retrieve the username in Google, Facebook,
+ Flickr and Twitter plugins (LP: #1565772)
+ * debian/control, debian/libaccount-plugin-facebook.install,
+ debian/libaccount-plugin-flickr.install,
+ debian/libaccount-plugin-twitter.install:
+ add packages containing plugin modules.
+ * debian/account-plugin-facebook.install,
+ debian/account-plugin-flickr.install,
+ debian/account-plugin-twitter.install:
+ remove unneeded webkit-options files.
+
+ -- David Barth Tue, 19 Jul 2016 13:28:04 +0000
+
account-plugins (0.12+16.04.20160126-0ubuntu1) xenial; urgency=medium
[ Alberto Mardegan ]
diff -Nru account-plugins-0.12+16.04.20160126/debian/control account-plugins-0.13+16.04.20160719/debian/control
--- account-plugins-0.12+16.04.20160126/debian/control 2016-08-25 07:21:18.000000000 +0000
+++ account-plugins-0.13+16.04.20160719/debian/control 2016-08-25 07:21:18.000000000 +0000
@@ -7,9 +7,11 @@
gobject-introspection,
python3,
pkg-config,
+ libaccount-plugin-1.0-dev (>= 0.1.9),
libaccounts-glib-dev (>= 1.10),
+ libjson-glib-dev,
libsignon-glib-dev,
- libaccount-plugin-1.0-dev (>= 0.1.3),
+ libsoup2.4-dev,
valac (>= 0.16),
gnome-common,
dh-autoreconf,
@@ -49,26 +51,47 @@
Description: GNOME Control Center account plugin for single signon
GNOME Control Center account plugins for single signon
+Package: libaccount-plugin-facebook
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends},
+ signon-plugin-oauth2,
+Description: GNOME Control Center account plugin for single signon - Facebook Auth
+ GNOME Control Center account plugins for single signon
+
Package: account-plugin-facebook
Architecture: all
Depends: ${misc:Depends},
- libaccount-plugin-generic-oauth | ubuntu-system-settings-online-accounts,
+ libaccount-plugin-facebook | ubuntu-system-settings-online-accounts,
unity-asset-pool (>> 0.8.24daily12.12.05-0ubuntu1),
Description: GNOME Control Center account plugin for single signon - facebook
GNOME Control Center account plugins for single signon
+Package: libaccount-plugin-twitter
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends},
+ signon-plugin-oauth2,
+Description: GNOME Control Center account plugin for single signon - Twitter Auth
+ GNOME Control Center account plugins for single signon
+
Package: account-plugin-twitter
Architecture: all
Depends: ${misc:Depends},
- libaccount-plugin-generic-oauth | ubuntu-system-settings-online-accounts,
+ libaccount-plugin-twitter | ubuntu-system-settings-online-accounts,
unity-asset-pool (>> 0.8.24daily12.12.05-0ubuntu1),
Description: GNOME Control Center account plugin for single signon - twitter
GNOME Control Center account plugins for single signon
+Package: libaccount-plugin-flickr
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends},
+ signon-plugin-oauth2,
+Description: GNOME Control Center account plugin for single signon - Flickr Auth
+ GNOME Control Center account plugins for single signon
+
Package: account-plugin-flickr
Architecture: all
Depends: ${misc:Depends},
- libaccount-plugin-generic-oauth | ubuntu-system-settings-online-accounts,
+ libaccount-plugin-flickr | ubuntu-system-settings-online-accounts,
unity-asset-pool (>> 0.8.24daily12.12.05-0ubuntu1),
Description: GNOME Control Center account plugin for single signon - flickr
GNOME Control Center account plugins for single signon
diff -Nru account-plugins-0.12+16.04.20160126/debian/libaccount-plugin-facebook.install account-plugins-0.13+16.04.20160719/debian/libaccount-plugin-facebook.install
--- account-plugins-0.12+16.04.20160126/debian/libaccount-plugin-facebook.install 1970-01-01 00:00:00.000000000 +0000
+++ account-plugins-0.13+16.04.20160719/debian/libaccount-plugin-facebook.install 2016-08-25 07:21:18.000000000 +0000
@@ -0,0 +1 @@
+usr/lib/libaccount-plugin-1.0/providers/libfacebook.so
diff -Nru account-plugins-0.12+16.04.20160126/debian/libaccount-plugin-flickr.install account-plugins-0.13+16.04.20160719/debian/libaccount-plugin-flickr.install
--- account-plugins-0.12+16.04.20160126/debian/libaccount-plugin-flickr.install 1970-01-01 00:00:00.000000000 +0000
+++ account-plugins-0.13+16.04.20160719/debian/libaccount-plugin-flickr.install 2016-08-25 07:21:18.000000000 +0000
@@ -0,0 +1 @@
+usr/lib/libaccount-plugin-1.0/providers/libflickr.so
diff -Nru account-plugins-0.12+16.04.20160126/debian/libaccount-plugin-twitter.install account-plugins-0.13+16.04.20160719/debian/libaccount-plugin-twitter.install
--- account-plugins-0.12+16.04.20160126/debian/libaccount-plugin-twitter.install 1970-01-01 00:00:00.000000000 +0000
+++ account-plugins-0.13+16.04.20160719/debian/libaccount-plugin-twitter.install 2016-08-25 07:21:18.000000000 +0000
@@ -0,0 +1 @@
+usr/lib/libaccount-plugin-1.0/providers/libtwitter.so
diff -Nru account-plugins-0.12+16.04.20160126/Makefile.am account-plugins-0.13+16.04.20160719/Makefile.am
--- account-plugins-0.12+16.04.20160126/Makefile.am 2016-01-26 10:52:34.000000000 +0000
+++ account-plugins-0.13+16.04.20160719/Makefile.am 2016-07-19 13:27:44.000000000 +0000
@@ -8,8 +8,11 @@
if ENABLE_LIBACCOUNT_PLUGIN
# Binary account plugins.
plugin_LTLIBRARIES = \
+ libfacebook.la \
+ libflickr.la \
libgeneric-oauth.la \
- libgoogle.la
+ libgoogle.la \
+ libtwitter.la
VALAFLAGS = \
--vapidir $(top_srcdir)/src \
@@ -36,12 +39,32 @@
-no-undefined \
-export-symbols-regex '^ap_module_get_object_type'
-libgoogle_la_CPPFLAGS = $(plugin_cppflags)
-libgoogle_la_LIBADD = $(plugin_libadd)
+libfacebook_la_CPPFLAGS = $(plugin_cppflags) $(RESTAPIS_CFLAGS)
+libfacebook_la_LIBADD = $(plugin_libadd) $(RESTAPIS_LIBS)
+libfacebook_la_LDFLAGS = $(plugin_ldflags)
+libfacebook_la_VALAFLAGS = --pkg libsoup-2.4 --pkg json-glib-1.0
+libfacebook_la_SOURCES = \
+ src/facebook.vala
+
+libflickr_la_CPPFLAGS = $(plugin_cppflags)
+libflickr_la_LIBADD = $(plugin_libadd)
+libflickr_la_LDFLAGS = $(plugin_ldflags)
+libflickr_la_SOURCES = \
+ src/flickr.vala
+
+libgoogle_la_CPPFLAGS = $(plugin_cppflags) $(RESTAPIS_CFLAGS)
+libgoogle_la_LIBADD = $(plugin_libadd) $(RESTAPIS_LIBS)
libgoogle_la_LDFLAGS = $(plugin_ldflags)
+libgoogle_la_VALAFLAGS = --pkg libsoup-2.4 --pkg json-glib-1.0
libgoogle_la_SOURCES = \
src/google.vala
+libtwitter_la_CPPFLAGS = $(plugin_cppflags)
+libtwitter_la_LIBADD = $(plugin_libadd)
+libtwitter_la_LDFLAGS = $(plugin_ldflags)
+libtwitter_la_SOURCES = \
+ src/twitter.vala
+
libgeneric_oauth_la_CPPFLAGS = $(plugin_cppflags)
libgeneric_oauth_la_LIBADD = $(plugin_libadd)
libgeneric_oauth_la_LDFLAGS = $(plugin_ldflags)
@@ -104,12 +127,9 @@
data/webkit-options/api.instagram.com.conf \
data/webkit-options/api.weibo.com.conf \
data/webkit-options/api.t.sohu.com.conf \
- data/webkit-options/api.twitter.com.conf \
data/webkit-options/foursquare.com.conf \
data/webkit-options/identi.ca.conf \
data/webkit-options/login.live.com.conf \
- data/webkit-options/login.yahoo.com.conf \
- data/webkit-options/www.facebook.com.conf \
data/webkit-options/www.linkedin.com.conf
dist_bin_SCRIPTS = \
diff -Nru account-plugins-0.12+16.04.20160126/src/facebook.vala account-plugins-0.13+16.04.20160719/src/facebook.vala
--- account-plugins-0.12+16.04.20160126/src/facebook.vala 1970-01-01 00:00:00.000000000 +0000
+++ account-plugins-0.13+16.04.20160719/src/facebook.vala 2016-07-19 13:27:44.000000000 +0000
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2016 Canonical, Inc
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
+ *
+ * Authors:
+ * Alberto Mardegan
+ */
+
+public class FacebookPlugin : Ap.OAuthPlugin {
+ private Soup.Session session;
+
+ public FacebookPlugin (Ag.Account account) {
+ Object (account: account);
+ }
+
+ private void fetch_username (string access_token) {
+ debug ("fetching username, AT = " + access_token);
+ Soup.URI destination_uri =
+ new Soup.URI ("https://graph.facebook.com/me?access_token=" +
+ access_token);
+ var message = new Soup.Message.from_uri ("GET", destination_uri);
+ session = new Soup.Session ();
+ session.queue_message (message, (sess, msg) => {
+ debug ("Got message reply");
+ string body = (string) msg.response_body.data;
+ Json.Parser parser = new Json.Parser ();
+ try {
+ parser.load_from_data (body);
+
+ Json.Node root = parser.get_root ();
+ Json.Object response_object = root.get_object ();
+ var username = response_object.get_string_member ("name");
+ account.set_display_name (username);
+ } catch (Error error) {
+ warning ("Could not parse reply: " + body);
+ }
+
+ store_account ();
+ });
+ }
+
+ protected override void query_username () {
+ var reply = get_oauth_reply ();
+ Variant? v_token = reply.lookup_value ("AccessToken", null);
+ if (v_token != null) {
+ fetch_username (v_token.get_string ());
+ } else {
+ store_account ();
+ }
+ }
+}
+
+public GLib.Type ap_module_get_object_type ()
+{
+ return typeof (FacebookPlugin);
+}
diff -Nru account-plugins-0.12+16.04.20160126/src/flickr.vala account-plugins-0.13+16.04.20160719/src/flickr.vala
--- account-plugins-0.12+16.04.20160126/src/flickr.vala 1970-01-01 00:00:00.000000000 +0000
+++ account-plugins-0.13+16.04.20160719/src/flickr.vala 2016-07-19 13:27:44.000000000 +0000
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2016 Canonical, Inc
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
+ *
+ * Authors:
+ * Alberto Mardegan
+ */
+
+public class FlickrPlugin : Ap.OAuthPlugin {
+ public FlickrPlugin (Ag.Account account) {
+ Object (account: account);
+ }
+
+ protected override void query_username () {
+ var reply = get_oauth_reply ();
+ Variant? v_name = reply.lookup_value ("username", null);
+ if (v_name != null) {
+ account.set_display_name (v_name.get_string ());
+ }
+
+ store_account ();
+ }
+}
+
+public GLib.Type ap_module_get_object_type ()
+{
+ return typeof (FlickrPlugin);
+}
diff -Nru account-plugins-0.12+16.04.20160126/src/google.vala account-plugins-0.13+16.04.20160719/src/google.vala
--- account-plugins-0.12+16.04.20160126/src/google.vala 2016-01-26 10:52:34.000000000 +0000
+++ account-plugins-0.13+16.04.20160719/src/google.vala 2016-07-19 13:27:44.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Canonical, Inc
+ * Copyright (C) 2012-2016 Canonical, Inc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -20,6 +20,8 @@
*/
public class GooglePlugin : Ap.OAuthPlugin {
+ private Soup.Session session;
+
public GooglePlugin (Ag.Account account) {
Object (account: account);
}
@@ -44,6 +46,43 @@
set_ignore_cookies (true);
}
+
+ private void fetch_username (string access_token) {
+ debug ("fetching username, AT = " + access_token);
+ Soup.URI destination_uri =
+ new Soup.URI ("https://www.googleapis.com/oauth2/v3/userinfo");
+ var message = new Soup.Message.from_uri ("POST", destination_uri);
+ message.request_headers.append ("Authorization", "Bearer " + access_token);
+ message.request_headers.set_content_length (0);
+ session = new Soup.Session ();
+ session.queue_message (message, (sess, msg) => {
+ debug ("Got message reply");
+ string body = (string) msg.response_body.data;
+ Json.Parser parser = new Json.Parser ();
+ try {
+ parser.load_from_data (body);
+
+ Json.Node root = parser.get_root ();
+ Json.Object response_object = root.get_object ();
+ var username = response_object.get_string_member ("email");
+ account.set_display_name (username);
+ } catch (Error error) {
+ warning ("Could not parse reply: " + body);
+ }
+
+ store_account ();
+ });
+ }
+
+ protected override void query_username () {
+ var reply = get_oauth_reply ();
+ Variant? v_token = reply.lookup_value ("AccessToken", null);
+ if (v_token != null) {
+ fetch_username (v_token.get_string ());
+ } else {
+ store_account ();
+ }
+ }
}
public GLib.Type ap_module_get_object_type ()
diff -Nru account-plugins-0.12+16.04.20160126/src/twitter.vala account-plugins-0.13+16.04.20160719/src/twitter.vala
--- account-plugins-0.12+16.04.20160126/src/twitter.vala 1970-01-01 00:00:00.000000000 +0000
+++ account-plugins-0.13+16.04.20160719/src/twitter.vala 2016-07-19 13:27:44.000000000 +0000
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2016 Canonical, Inc
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
+ *
+ * Authors:
+ * Alberto Mardegan
+ */
+
+public class TwitterPlugin : Ap.OAuthPlugin {
+ public TwitterPlugin (Ag.Account account) {
+ Object (account: account);
+ }
+
+ protected override void query_username () {
+ var reply = get_oauth_reply ();
+ Variant? v_name = reply.lookup_value ("ScreenName", null);
+ if (v_name != null) {
+ account.set_display_name (v_name.get_string ());
+ } else {
+ v_name = reply.lookup_value ("UserId", null);
+ if (v_name != null) {
+ account.set_display_name (v_name.get_string ());
+ }
+ }
+
+ store_account ();
+ }
+}
+
+public GLib.Type ap_module_get_object_type ()
+{
+ return typeof (TwitterPlugin);
+}