Modifications entre les versions 2 et 4 (s'étendant sur 2 versions)
Version 2 à la date du 2013-02-21 18:29:23
Taille: 10075
Éditeur: MoussaNombre
Commentaire: aïe !
Version 4 à la date du 2013-02-22 14:42:41
Taille: 10098
Éditeur: MoussaNombre
Commentaire: merci JC
Texte supprimé. Texte ajouté.
Ligne 59: Ligne 59:
  * appliquer le patch de Inverse : `patch -p0 lasso-export.diff`
Ligne 60: Ligne 61:
   * ./configure
Ligne 64: Ligne 64:
   * Cyrus SASL (ftp://ftp.cyrusimap.org/cyrus-sasl/cyrus-sasl-2.1.26.tar.gz)
    * ./configure --prefix=/opt/cyrus-sasl
   * aptitude install libsasl2-dev
Ligne 67: Ligne 66:
  * modifier : fichier configure
   {{{
10900
-LIBS="-lsasl $LIBS"
+LIBS="-lsasl2 $LIBS"
10935
- LIBS="-lsasl $LIBS"
+ LIBS="-lsasl2 $LIBS"
   }}}
  *./configure --prefix=/opt/crudesaml --with-sasl2=/opt/cyrus-sasl
  * modifier : fichier Makefile
   {{{
-libsaml_la_CFLAGS = -I/usr/include/sasl
+libsaml_la_CFLAGS = -I/opt/cyrus-sasl/include/sasl
   }}}
  * make
  * make install
   {{{
   * modif du fichier plugin_common.h
    {{{
#include <saslplug.h> :
+typedef int (*sasl_callback_ft)(void);
    }}}
   * ./configure && make && make install
    {{{
Ligne 86: Ligne 74:
make[1]: Entering directory `/usr/local/src/crudesaml-1.4'
make[1]: Nothing to be done for `install-exec-am'.
make[1]: entrant dans le répertoire « /usr/local/src/crudesaml-1.4 »
make[1]: Rien à faire pour « install-exec-am ».
Ligne 90: Ligne 78:
 /bin/mkdir -p '/opt/cyrus-sasl/lib/sasl2'
 /bin/bash ./libtool --mode=install /usr/bin/install -c libsaml.la '/opt/cyrus-sasl/lib/sasl2'
libtool: install: /usr/bin/install -c .libs/libsaml.so.0.2.0 /opt/cyrus-sasl
/lib/sasl2/libsaml.so.0.2.0
libtool: install: (cd /opt/cyrus-sasl/lib/sasl2 && { ln -s -f libsaml.so.0.2.0 libsaml.so.0 || { rm -f libsaml.so.0 && ln -s libsaml.so.0.2.0 libsaml.so.0; }; })
libtool: install: (cd /opt/cyrus-sasl/lib/sasl2 && { ln -s -f libsaml.so.0.2.0 libsaml.so || { rm -f libsaml.so && ln -s libsaml.so.0.2.0 libsaml.so; }; })
libtool: install: /usr/bin/install -c .libs/libsaml.lai /opt/cyrus-sasl/lib/sasl2/libsaml.la
libtool: install: /usr/bin/install -c .libs/libsaml.a /opt/cyrus-sasl
/lib/sasl2/libsaml.a
libtool: install: chmod 644 /opt/cyrus-sasl/lib/sasl2/libsaml.a
libtool: install: ranlib /opt/cyrus-sasl
/lib/sasl2/libsaml.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /opt/cyrus-sasl/lib/sasl2
 /bin/mkdir -p '/lib/sasl2'
 /bin/bash ./libtool --mode=install /usr/bin/install -c libsaml.la '/lib/sasl2'
libtool: install: /
usr/bin/install -c .libs/libsaml.so.0.2.0 /lib/sasl2/libsaml.so.0.2.0
libtool: install: (cd /lib/sasl2 && { ln -s -f libsaml.so.0.2.0 libsaml.so.0 || { rm -f libsaml.so.0 && ln -s li
})
libtool: install: (cd /lib/sasl2 && { ln -s -f libsaml.so.0.2.0 libsaml.so || { rm -f libsaml.so && ln -s libsam
libtool: install: /usr/bin/install -c .libs/libsaml.lai /lib/sasl2/libsaml.la
libtool: install: /
usr/bin/install -c .libs/libsaml.a /lib/sasl2/libsaml.a
libtool: install: chmod 644 /lib/sasl2/libsaml.a
libtool: install: ranlib
/lib/sasl2/libsaml.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /lib/sasl
Ligne 102: Ligne 91:
   /opt/cyrus-sasl/lib/sasl2    /lib/sasl2
Ligne 115: Ligne 104:
Ligne 121: Ligne 111:
libtool: install: (cd /usr/local/lib/security && { ln -s -f pam_saml.so.0.2.0 pam_saml.so.0 || { rm -f pam_saml.so.0 && ln -s pam_saml.so.0.2.0 pam_saml.so.0; }; })
libtool: install: (cd /usr/local/lib/security && { ln -s -f pam_saml.so.0.2.0 pam_saml.so || { rm -f pam_saml.so && ln -s pam_saml.so.0.2.0 pam_saml.so; }; })
libtool: install: (cd /usr/local/lib/security && { ln -s -f pam_saml.so.0.2.0 pam_saml.so.0 || { rm -f pam_saml.
pam_saml.so.0; }; })
libtool: install: (cd /usr/local/lib/security && { ln -s -f pam_saml.so.0.2.0 pam_saml.so || { rm -f pam_saml.so
saml.so; }; })
Ligne 127: Ligne 119:
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /usr/local/lib/security libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /usr/loca
Ligne 146: Ligne 138:
make[1]: Leaving directory `/usr/local/src/crudesaml-1.4' make[1]: quittant le répertoire « /usr/local/src/crudesaml-1.4 »
Ligne 148: Ligne 140:
    }}}
  * les librairies aux bons endroits :
   {{{
root@sogo-test-saml:/usr/lib/sasl2# cp -a /lib/sasl2/* /usr/lib/sasl2/
root@sogo-test-saml:/usr/lib/sasl2# cp -a /usr/lib/security/pam_saml.so.0.2.0 /lib/security/pam_saml.so
   }}}
  * vérification
   {{{
root@sogo-test-saml:/usr/lib/sasl2# saslpluginviewer
Plugin "saml" [loaded], API version: 4
        SASL mechanism: SAML, best SSF: 0
        security flags: NO_ANONYMOUS
        features: WANT_CLIENT_FIRST|PROXY_AUTHENTICATION
Ligne 160: Ligne 165:
defaults -u sogo write sogod NGImap4AuthMechanism "SAML"

Tests d'intégration SOGo et SAML

Échanges avec Inverse

Le mainteneur de CrudeSAML a publié une nouvelle version avec mes correctifs:

http://ftp.espci.fr/pub/crudesaml/crudesaml-1.4.tar.gz

********

J'ai terminé l'implémentation du support SAML dans SOGo en vue de se 
connecter à Dovecot via le module PAM/SASL crudesaml.

À l'aide de l'auteur de crudesaml, j'ai dû adapter le code de trois 
composants (en plus de SOGo):
- Dovecot pour accepter des "mots de passe" de plus de 1000 caractères
- liblasso pour qu'il exporte la fonction utilisée par crudesaml
- crudesaml pour réduire le nombre de warnings et de prototypes mal 
configurés lors de la compilation.

Je joins ces patches à ce message, même si j'ai déja envoyé l'un d'eux à 
Jean-Christophe.

Au niveau de SOGo, la fonctionnalité sera présente dans la version 2.0.3 
de SOGo. Et le guide d'installation a été mis à jour concernant les 
nouvelles directives de configuration.

Notez que j'ai utilisé simplesamlphp comme idp. Je vous suggèrerais de 
tester les nightly builds de demain pour corriger tout éventuel problème 
le plus vite possible.

*********

>> Peux-tu me dire quelle patch ne s'applique pas correctement? 
> Celui pour Dovecot, qui est super simple (1 seule ligne) avec Dovecot 2.x (Debian testing) mais pour lequel nous n'avons pas trouvé d'équivalent dans le code source de Dovecot 1.x (Debian stable). 
Avec v1.2, ca devrait fonctionner, car on a dans le code:

./src/login-common/client-common.h:#define LOGIN_MAX_INBUF_SIZE 8192 

Serveur de test

  • copie du CT sogo-test.ca.auf.org ==> sogo-test-saml.ca.auf.org

  • installation en local de : dovecot-imapd (1:1.2.15-7) + postfix
  • sogo (nightly) : 2.0.0.20130218-1

installation "manuelle" des paquets requis

  • lasso (https://dev.entrouvert.org/lasso/lasso-2.3.6.tar.gz)

    • pré-requis :
      • aptitude install zlib1g-dev
      • aptitude install pkg-config
      • configure: error: Package requirements (glib-2.0 >= 2.4.0 gobject-2.0 >= 2.4.0 libxml-2.0 xmlsec1 >= 1.2.6 xmlsec1-openssl >= 1.2.6 openssl) were not met :

        • aptitude install libglib2.0-dev (==> glib-2.0 >= 2.4.0 gobject-2.0)

        • aptitude install libxmlsec1-dev ==> libxml-2.0 xmlsec1 >= 1.2.6 xmlsec1-openssl >= 1.2.6 openssl

    • appliquer le patch de Inverse : patch -p0 lasso-export.diff

    • lire le INSTALL pour l'installation (./configure ; make ; make install)

  • crudesaml (http://ftp.espci.fr/pub/crudesaml/crudesaml-1.4.tar.gz)

    • pré-requis :
      • aptitude install libsasl2-dev
      • aptitude install libpam0g-dev
      • modif du fichier plugin_common.h
        • #include <saslplug.h> :
          +typedef int (*sasl_callback_ft)(void);
      • ./configure && make && make install

        • root@sogo-test-saml:/usr/local/src/crudesaml-1.4# make install
          make[1]: entrant dans le répertoire « /usr/local/src/crudesaml-1.4 »
          make[1]: Rien à faire pour « install-exec-am ».
           /bin/mkdir -p '/usr/local/share/man/man5'
           /usr/bin/install -c -m 644 pam_saml.5 cy2_saml.5 '/usr/local/share/man/man5'
           /bin/mkdir -p '/lib/sasl2'
           /bin/bash ./libtool   --mode=install /usr/bin/install -c   libsaml.la '/lib/sasl2'   
          libtool: install: /usr/bin/install -c .libs/libsaml.so.0.2.0 /lib/sasl2/libsaml.so.0.2.0
          libtool: install: (cd /lib/sasl2 && { ln -s -f libsaml.so.0.2.0 libsaml.so.0 || { rm -f libsaml.so.0 && ln -s li
          })
          libtool: install: (cd /lib/sasl2 && { ln -s -f libsaml.so.0.2.0 libsaml.so || { rm -f libsaml.so && ln -s libsam
          libtool: install: /usr/bin/install -c .libs/libsaml.lai /lib/sasl2/libsaml.la
          libtool: install: /usr/bin/install -c .libs/libsaml.a /lib/sasl2/libsaml.a
          libtool: install: chmod 644 /lib/sasl2/libsaml.a
          libtool: install: ranlib /lib/sasl2/libsaml.a
          libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /lib/sasl
          ----------------------------------------------------------------------
          Libraries have been installed in:
             /lib/sasl2
          
          If you ever happen to want to link against installed libraries
          in a given directory, LIBDIR, you must either use libtool, and
          specify the full pathname of the library, or use the `-LLIBDIR'
          flag during linking and do at least one of the following:
             - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
               during execution
             - add LIBDIR to the `LD_RUN_PATH' environment variable
               during linking
             - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
             - have your system administrator add LIBDIR to `/etc/ld.so.conf'
          
          
          See any operating system documentation about shared libraries for
          more information, such as the ld(1) and ld.so(8) manual pages.
          ----------------------------------------------------------------------
           /bin/mkdir -p '/usr/local/lib/security'
           /bin/bash ./libtool   --mode=install /usr/bin/install -c   pam_saml.la '/usr/local/lib/security'
          libtool: install: /usr/bin/install -c .libs/pam_saml.so.0.2.0 /usr/local/lib/security/pam_saml.so.0.2.0
          libtool: install: (cd /usr/local/lib/security && { ln -s -f pam_saml.so.0.2.0 pam_saml.so.0 || { rm -f pam_saml.
          pam_saml.so.0; }; })
          libtool: install: (cd /usr/local/lib/security && { ln -s -f pam_saml.so.0.2.0 pam_saml.so || { rm -f pam_saml.so
          saml.so; }; })
          libtool: install: /usr/bin/install -c .libs/pam_saml.lai /usr/local/lib/security/pam_saml.la
          libtool: install: /usr/bin/install -c .libs/pam_saml.a /usr/local/lib/security/pam_saml.a
          libtool: install: chmod 644 /usr/local/lib/security/pam_saml.a
          libtool: install: ranlib /usr/local/lib/security/pam_saml.a
          libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /usr/loca
          ----------------------------------------------------------------------
          Libraries have been installed in:
             /usr/local/lib/security
          
          If you ever happen to want to link against installed libraries
          in a given directory, LIBDIR, you must either use libtool, and
          specify the full pathname of the library, or use the `-LLIBDIR'
          flag during linking and do at least one of the following:
             - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
               during execution
             - add LIBDIR to the `LD_RUN_PATH' environment variable
               during linking
             - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
             - have your system administrator add LIBDIR to `/etc/ld.so.conf'
          
          See any operating system documentation about shared libraries for
          more information, such as the ld(1) and ld.so(8) manual pages.
          ----------------------------------------------------------------------
          make[1]: quittant le répertoire « /usr/local/src/crudesaml-1.4 »
          root@sogo-test-saml:/usr/local/src/crudesaml-1.4#
    • les librairies aux bons endroits :
      • root@sogo-test-saml:/usr/lib/sasl2# cp -a /lib/sasl2/* /usr/lib/sasl2/
        root@sogo-test-saml:/usr/lib/sasl2# cp -a /usr/lib/security/pam_saml.so.0.2.0 /lib/security/pam_saml.so
    • vérification
      • root@sogo-test-saml:/usr/lib/sasl2# saslpluginviewer
        Plugin "saml" [loaded],         API version: 4
                SASL mechanism: SAML, best SSF: 0
                security flags: NO_ANONYMOUS
                features: WANT_CLIENT_FIRST|PROXY_AUTHENTICATION

Configuration de SOGo

  • modification de la config SOGo :
    • defaults -u sogo write sogod SOGoAuthenticationType "saml2"
      defaults -u sogo write sogod SOGoSAML2PrivateKeyLocation "/etc/ssl/certs/saml-sogo-test-saml.ca.auf.org-cert.pem"
      defaults -u sogo write sogod SOGoSAML2CertiticateLocation "/etc/ssl/private/saml-sogo-test-saml.ca.auf.org-key.pem"
      defaults -u sogo write sogod SOGoSAML2IdpMetadataLocation "/etc/ssl/saml-id.auf.org-metadata.xml"
      defaults -u sogo write sogod SOGoSAML2IdpPublicKeyLocation "/etc/ssl/certs/_.auf.org-cert.pem"
      defaults -u sogo write sogod SOGoSAML2IdpCertificateLocation "etc/ssl/certs/GandiStandardSSLCA.pem"
      defaults -u sogo write sogod SOGoSAML2LogoutEnabled yes
      defaults -u sogo write sogod NGImap4AuthMechanism "SAML"

A VOIR : SOGoSAML2IdpPublicKeyLocation et SOGoSAML2IdpCertificateLocation ont été positionnés sur les certificats utilisés par id.auf.org.

  • est-ce bien ça qu'il faut mettre ici ?
  • restart de SOGo
  • test N°1 : récupération des métadata : https://sogo-test-saml.ca.auf.org/SOGo/saml2-metadata

    • Feb 19 16:41:35 sogod [31252]: |SOGo| starting method 'GET' on uri '/SOGo/saml2-metadata'
      Feb 19 16:41:35 sogod [31252]: [ERROR] [so-action 0x0xb8623808 SOGoSAML2Actions] did not find action class: SOGoSAML2Actions
      Feb 19 16:41:35 sogod [31252]: [ERROR] [so-action 0x0xb8354ef8 SOGoSAML2Actions] did not find method 'SOGoSAML2Actions'
      2013-02-19 16:41:35.370 sogod[31252] <MySQL4Channel[0x0xb83876f0] connection=0x0xb82430b8> SQL: SELECT * FROM auf_users WHERE (c_uid = 'saml2-metadata') OR (mail_pays = 'saml2-metadata') OR (mail = 'saml2-metadata');
      2013-02-19 16:41:35.370 sogod[31252] <MySQL4Channel[0x0xb83876f0] connection=0x0xb82430b8>   query has results, entering fetch-mode.
      2013-02-19 16:41:35.370 sogod[31252] <MySQL4Channel[0x0xb83876f0] connection=0x0xb82430b8> SQL: SELECT c_uid FROM auf_users WHERE (c_uid = 'saml2-metadata') AND (source = 'LOCAL');
      2013-02-19 16:41:35.371 sogod[31252] <MySQL4Channel[0x0xb83876f0] connection=0x0xb82430b8>   query has results, entering fetch-mode.
      Feb 19 16:41:35 sogod [31252]: [ERROR] [so-action 0x0xb85eb460 SOGoSAML2Actions] did not find action class: SOGoSAML2Actions
      Feb 19 16:41:35 sogod [31252]: [ERROR] [so-action 0x0xb8354ef8 SOGoSAML2Actions] did not find method 'SOGoSAML2Actions'
      Feb 19 16:41:35 sogod [31252]: [ERROR] [so-action 0x0xb85a2670 SOGoSAML2Actions] did not find action class: SOGoSAML2Actions
      Feb 19 16:41:35 sogod [31252]: [ERROR] [so-action 0x0xb8354ef8 SOGoSAML2Actions] did not find method 'SOGoSAML2Actions'
      Feb 19 16:41:35 sogod [31252]: |SOGo| request took 0.002779 seconds to execute
      10.36.1.4 - - [19/Feb/2013:16:41:35 GMT] "GET /SOGo/saml2-metadata HTTP/1.1" 404 43/0 0.004 - - 0

Projet/SOGo/TestsSAML (dernière édition le 2016-02-03 15:49:47 par MoussaNombre)