KTp/Setting up KAccounts: Difference between revisions

From KDE Community Wiki
< KTp
No edit summary
 
(15 intermediate revisions by 4 users not shown)
Line 4: Line 4:
a provider, etc).
a provider, etc).


https://code.google.com/p/accounts-sso/
https://gitlab.com/groups/accounts-sso
 
 
 
{{Warning|You still need to build and install ktp-accounts-kcm}}
 
 


First of all set up your paths, that allows to easily just copy-paste the rest from below. This is needed for the set-up only, not for the runtime. However, it uses D-BUS activation, so make sure the path you set for ACCOUNTS_PREFIX allows for D-BUS autostarting (ie. $ACCOUNTS_PREFIX/share/dbus-1/services is loaded by D-BUS).
First of all set up your paths, that allows to easily just copy-paste the rest from below. This is needed for the set-up only, not for the runtime. However, it uses D-BUS activation, so make sure the path you set for ACCOUNTS_PREFIX allows for D-BUS autostarting (ie. $ACCOUNTS_PREFIX/share/dbus-1/services is loaded by D-BUS).
Line 30: Line 36:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
     git clone https://code.google.com/p/accounts-sso.libaccounts-glib/ libaccounts-glib
     git clone https://gitlab.com/accounts-sso/libaccounts-glib.git
     cd libaccounts-glib
     cd libaccounts-glib
     HAVE_GCOV_FALSE='#' ./autogen.sh --prefix=$ACCOUNTS_PREFIX --enable-debug
     HAVE_GCOV_FALSE='#' ./autogen.sh --prefix=$ACCOUNTS_PREFIX --enable-debug
Line 41: Line 47:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
     git clone https://code.google.com/p/accounts-sso.libaccounts-qt/ libaccounts-qt
     git clone https://gitlab.com/accounts-sso/libaccounts-qt.git
     cd libaccounts-qt
     cd libaccounts-qt
     qmake PREFIX=$ACCOUNTS_PREFIX LIBDIR=$ACCOUNTS_LIBDIR
     qmake PREFIX=$ACCOUNTS_PREFIX LIBDIR=$ACCOUNTS_LIBDIR
Line 66: Line 72:
in our applications to talk to the daemon.
in our applications to talk to the daemon.
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
     git clone https://code.google.com/p/accounts-sso.signond/ signond
     git clone https://gitlab.com/accounts-sso/signond.git
     qmake PREFIX=$ACCOUNTS_PREFIX LIBDIR=$ACCOUNTS_LIBDIR
    cd signond
     qmake PREFIX=$ACCOUNTS_PREFIX LIBDIR=$ACCOUNTS_LIBDIR "QMAKE_RPATHDIR+=$ACCOUNTS_LIBDIR"
     make install
     make install
</syntaxhighlight>
</syntaxhighlight>
Line 79: Line 86:
store secrets (tokens and passwords) in plain text
store secrets (tokens and passwords) in plain text
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
     git clone git://anongit.kde.org/signon-kwallet-extension.git
     git clone kde:signon-kwallet-extension
     mkdir signon-kwallet-extension/build
     mkdir signon-kwallet-extension/build
     cd signon-kwallet-extension/build
     cd signon-kwallet-extension/build
Line 89: Line 96:
This plugin makes signond able to deal with oauth2 authentication
This plugin makes signond able to deal with oauth2 authentication
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
     git clone https://code.google.com/p/accounts-sso.signon-plugin-oauth2/ signon-plugin-oauth2
     git clone https://gitlab.com/accounts-sso/signon-plugin-oauth2.git
     mkdir signon-plugin-oauth2/build
     mkdir signon-plugin-oauth2/build
     cd signon-plugin-oauth2/build
     cd signon-plugin-oauth2/build
     qmake .. PREFIX=$ACCOUNTS_PREFIX LIBDIR=$ACCOUNTS_LIBDIR
     qmake .. PREFIX=$ACCOUNTS_PREFIX LIBDIR=$ACCOUNTS_LIBDIR "QMAKE_RPATHDIR+=$ACCOUNTS_LIBDIR"
     make install
     make install
</syntaxhighlight>
</syntaxhighlight>
Line 101: Line 108:
     bzr branch lp:signon-ui
     bzr branch lp:signon-ui
     cd signon-ui
     cd signon-ui
     qmake PREFIX=$ACCOUNTS_PREFIX LIBDIR=$ACCOUNTS_LIBDIR
     qmake PREFIX=$ACCOUNTS_PREFIX LIBDIR=$ACCOUNTS_LIBDIR "QMAKE_RPATHDIR+=$ACCOUNTS_LIBDIR"
     make install
     make install
</syntaxhighlight>
</syntaxhighlight>


Note that this project does **NOT** support out of tree builds
Note that this project does **NOT** support out of tree builds
===Mission Control plugin===
To give Telepathy access to your accounts in KAccounts, you need to build this plugin, but it requires signon-glib first:
<syntaxhighlight lang="bash">
    git clone https://gitlab.com/accounts-sso/libsignon-glib.git
    cd libsignon-glib
    HAVE_GCOV_FALSE='#' ./autogen.sh --prefix=$ACCOUNTS_PREFIX --enable-debug
    make
    make install
</syntaxhighlight>
And now the plugin itself
<syntaxhighlight lang="bash">
    git clone https://gitlab.com/accounts-sso/telepathy-accounts-signon.git
    mkdir telepathy-accounts-signon/build
    cd telepathy-accounts-signon/build
    qmake .. PREFIX=$ACCOUNTS_PREFIX LIBDIR=$ACCOUNTS_LIBDIR "QMAKE_RPATHDIR+=$ACCOUNTS_LIBDIR"
    make install
</syntaxhighlight>
==KAccounts integration==
This is a support library, a kcm module and a daemon running in the background.
<syntaxhighlight lang="bash">
    git clone kde:kaccounts-integration
    mkdir kaccounts-integration/build
    cd kaccounts-integration/build
    cmake ../ -DCMAKE_INSTALL_PREFIX=$ACCOUNTS_PREFIX
    make install
</syntaxhighlight>


==KAccounts providers==
==KAccounts providers==
Line 113: Line 151:
of icons and .xml files
of icons and .xml files
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
     git clone kde:kaccounts-providers --branch frameworks
     git clone kde:kaccounts-providers
     mkdir kaccounts-providers/build
     mkdir kaccounts-providers/build
     cd kaccounts-providers/build
     cd kaccounts-providers/build
Line 120: Line 158:
</syntaxhighlight>
</syntaxhighlight>


==KAccounts integration==
{{Warning|Now you still need to build and install ktp-accounts-kcm (this is important!)}}
This is a support library, a kcm module and a daemon running in the background.
<syntaxhighlight lang="bash">
    git clone kde:kaccounts-integration --branch frameworks
    mkdir kaccounts-integration/build
    cd kaccounts-integration/build
    cmake ../ -DCMAKE_INSTALL_PREFIX=$ACCOUNTS_PREFIX
    make install
</syntaxhighlight>

Latest revision as of 08:41, 21 July 2015

Setting up accounts-sso

Accounts-SSO is the framework we are using to store secrets (tokens, passwords) and for storing Accounts (small pieces of information containing a name, a provider, etc).

https://gitlab.com/groups/accounts-sso


Warning

You still need to build and install ktp-accounts-kcm



First of all set up your paths, that allows to easily just copy-paste the rest from below. This is needed for the set-up only, not for the runtime. However, it uses D-BUS activation, so make sure the path you set for ACCOUNTS_PREFIX allows for D-BUS autostarting (ie. $ACCOUNTS_PREFIX/share/dbus-1/services is loaded by D-BUS).

export ACCOUNTS_PREFIX=your path here
export ACCOUNTS_LIBDIR=your lib dir here


An example:

export ACCOUNTS_PREFIX=/opt/kde
export ACCOUNTS_LIBDIR=/opt/kde/lib

Accounts

This is a fairly simply yet powerful framework, it stores all information into a sqlite database and then propagates the modifications using dbus so all applications using libaccounts will be aware of the modifications.

libaccounts-glib

The first thing to compile is libaccounts-glib, which is the code implementing all the Read/Write/Notification of Accounts:

    git clone https://gitlab.com/accounts-sso/libaccounts-glib.git
    cd libaccounts-glib
    HAVE_GCOV_FALSE='#' ./autogen.sh --prefix=$ACCOUNTS_PREFIX --enable-debug
    make
    make install

libaccounts-qt

This is the Qt bindings for libaccounts-glib, it uses qmake :/

    git clone https://gitlab.com/accounts-sso/libaccounts-qt.git
    cd libaccounts-qt
    qmake PREFIX=$ACCOUNTS_PREFIX LIBDIR=$ACCOUNTS_LIBDIR
    make install

Note that at this very day libaccounts-qt qmake does **NOT** support compiling the library outside the source directory, this means that the command qmake must be executed within the root of libaccounts-qt and not for example in a build directory.

SSO

Single Sign On is the part of the framework responsable for storing and obtaining credentials. It stores the credentials in a secure way (in case of KDE within KWallet) and has a plugin system to do authentication in most common cases such oauth/2 or simple user and password.

An interface can be plugged into SSO, at this moment we are using ubuntu's implementation signon-ui.

signond

This includes a daemon that will be dbus activated and will offer a set of dbus api to access to credentials and to authenticate to services (google/facebook oauth or owncloud user/password). Within this same repo there is a Qt library that we'll use in our applications to talk to the daemon.

    git clone https://gitlab.com/accounts-sso/signond.git
    cd signond
    qmake PREFIX=$ACCOUNTS_PREFIX LIBDIR=$ACCOUNTS_LIBDIR "QMAKE_RPATHDIR+=$ACCOUNTS_LIBDIR"
    make install

Note: Since signond is *dbus* activated be sure that the file `com.google.code.AccountsSSO.SingleSignOn.service` is in a location where dbus can find it (usually /usr/share/dbus-1/services)

Wallet support

In order for sigond to talk to KWallet we need a plugin for it, otherwise it will store secrets (tokens and passwords) in plain text

    git clone kde:signon-kwallet-extension
    mkdir signon-kwallet-extension/build
    cd signon-kwallet-extension/build
    cmake ../ -DCMAKE_INSTALL_PREFIX=$ACCOUNTS_PREFIX
    make install

oauth2 plugin

This plugin makes signond able to deal with oauth2 authentication

    git clone https://gitlab.com/accounts-sso/signon-plugin-oauth2.git
    mkdir signon-plugin-oauth2/build
    cd signon-plugin-oauth2/build
    qmake .. PREFIX=$ACCOUNTS_PREFIX LIBDIR=$ACCOUNTS_LIBDIR "QMAKE_RPATHDIR+=$ACCOUNTS_LIBDIR"
    make install

signon-ui

At the moment we are u sing Ubuntu's UI which is under CLA and hosted in Launchpad.

    bzr branch lp:signon-ui
    cd signon-ui
    qmake PREFIX=$ACCOUNTS_PREFIX LIBDIR=$ACCOUNTS_LIBDIR "QMAKE_RPATHDIR+=$ACCOUNTS_LIBDIR"
    make install

Note that this project does **NOT** support out of tree builds

Mission Control plugin

To give Telepathy access to your accounts in KAccounts, you need to build this plugin, but it requires signon-glib first:

    git clone https://gitlab.com/accounts-sso/libsignon-glib.git
    cd libsignon-glib
    HAVE_GCOV_FALSE='#' ./autogen.sh --prefix=$ACCOUNTS_PREFIX --enable-debug
    make
    make install

And now the plugin itself

    git clone https://gitlab.com/accounts-sso/telepathy-accounts-signon.git
    mkdir telepathy-accounts-signon/build
    cd telepathy-accounts-signon/build
    qmake .. PREFIX=$ACCOUNTS_PREFIX LIBDIR=$ACCOUNTS_LIBDIR "QMAKE_RPATHDIR+=$ACCOUNTS_LIBDIR"
    make install

KAccounts integration

This is a support library, a kcm module and a daemon running in the background.

    git clone kde:kaccounts-integration
    mkdir kaccounts-integration/build
    cd kaccounts-integration/build
    cmake ../ -DCMAKE_INSTALL_PREFIX=$ACCOUNTS_PREFIX
    make install

KAccounts providers

This are the providers and services that at this very moment we provide support for. For example in Facebook we support Chat, Contacts Calendar... for what we need a facebook.provider and chat/contacts/calendar.service files. This is basically a bunch of icons and .xml files

    git clone kde:kaccounts-providers
    mkdir kaccounts-providers/build
    cd kaccounts-providers/build
    cmake ../ -DCMAKE_INSTALL_PREFIX=$ACCOUNTS_PREFIX
    make install

Warning

Now you still need to build and install ktp-accounts-kcm (this is important!)