===== simpleSAMLphp ===== ===== reference ====== * https://aresu.dsi.cnrs.fr/spip.php?article180 * https://tuakiri.ac.nz/confluence/display/Tuakiri/Installing+a+SimpleSAMLphp+SP * https://simplesamlphp.org/docs/stable/simplesamlphp-sp ===== installation tgz ===== * https://simplesamlphp.org/archive apres une oremiere tentative a base de rpm restart from stractch en tar.gz [root@mu www]# wget https://github.com/simplesamlphp/simplesamlphp/releases/download/v1.17.5/simplesamlphp-1.17.5.tar.gz [root@mu www]# tar xvfz simplesamlphp-1.17.5.tar.gz [root@mu www]# ln -s simplesamlphp-1.17.5 simplesaml [root@mu www]# chown apache simplesaml -R ==== modules php ==== modules php necessaires, notament php-mcrypt (fpm, pdo peut-etre ... ) php-common-5.4.16-42.el7.x86_64 php-cli-5.4.16-42.el7.x86_64 php-xml-5.4.16-42.el7.x86_64 php-ldap-5.4.16-42.el7.x86_64 php-5.4.16-42.el7.x86_64 php-pdo-5.4.16-42.el7.x86_64 simplesamlphp-1.14.2-5.el6.noarch php-mcrypt-5.4.16-7.el7.x86_64 php-fpm-5.4.16-42.el7.x86_64 ===== config ===== [root@mu simplesaml]# cp config/config.php config/config.php.orig [root@mu simplesaml]# cp -p config-templates/config.php config/ cp : voulez-vous écraser « config/config.php » ? y Modifier les valeurs suivantes dans config.php: * 'auth.adminpassword' => '', * secretsalt' => '', * 'technicalcontact_name' => '', * 'technicalcontact_email' => '', puis on passe au fichier qui décrit les différents SP, authsource.php, on le copie depuis le répertoire des templates : cp -p config-templates/authsources.php config/ vim config/authsources.php ===== certificat ===== creation d'un certificat chiffrer le echanges SAML de ce SP [root@share ~]# openssl req -newkey rsa:2048 -new -x509 -days 3652 -nodes -out saml.crt -keyout saml.pem [root@share ~]# cp saml.pem saml.crt /var/www/simplesaml/cert [root@share simplesaml]# cd cert/ [root@share cert]# chmod 600 saml.* ===== AuthSources ===== definir l'entityID et DiscoveryURL pour notre federation et le certificat + key 'entityID' => 'https://share.tem-tsp.eu/simplesamlSP', 'discoURL' => => 'https://federation.tem-tsp.eu/wayf/WAYF', // certs JP 'privatekey' => '/var/www/share/simplesaml/cert/saml.pem', 'certificate' => '/var/www/share/simplesaml/cert/saml.crt', ===== Metadata ===== * https://simplesamlphp.org/docs/stable/simplesamlphp-automated_metadata * https://tuakiri.ac.nz/confluence/display/Tuakiri/Installing+a+SimpleSAMLphp+SP#InstallingaSimpleSAMLphpSP-Loadingthefederationmetadata [root@share simplesaml]# touch modules/metarefresh/enable [root@share simplesaml]# cp -p modules/metarefresh/config-templates/config-metarefresh.php config/ [root@share simplesaml]# vim config/config-metarefresh.php nomer la federation (fedelocal vs kalmar) et pointer sur les bonnes sources de telechargement recuperer le certificat de la federation [root@share cert]# wget https://federation.tem-tsp.eu/metadata/fede-local-cert.pem generation du fingerprint pour l'inclure dans la conf : [root@share simplesaml]# openssl x509 -noout -fingerprint -in cert/fede-local-cert.pem SHA1 Fingerprint=AE:07:E7:6E:F9:DD:EA:3E:97:AF:CA:A5:CF:36:3E:BE:3A:A8:78:5C definition de l'arborescence de stockage ds metadonnées [root@share simplesaml]# vim config/config-metarefresh.php [root@share simplesaml]# mkdir metadata/metadata-fedelocal-consuming/ [root@share simplesaml]# chown apache metadata/metadata-fedelocal-consuming/ definition du repertoire de stockage des metadata dans le config.php 'metadata.sources' => array( array('type' => 'flatfile'), array('type' => 'flatfile', 'directory' => 'metadata/metadata-fedelocal-consuming'), ), automatisation [root@share simplesamlphp-1.14.11]# touch modules/cron/enable [root@share simplesamlphp-1.14.11]# cp modules/cron/config-templates/*.php config/ [root@share simplesamlphp-1.14.11]# ls -l modules/metarefresh/enable -rw-r--r-- 1 apache root 0 10 févr. 16:26 modules/metarefresh/enable test manuel [root@share bin]# ./metarefresh.php -s https://federation.domain.fr/metadata/fede-locale-signed.xml mise a jour manuelle via web https://share.tem-tsp.eu/simplesaml/module.php/metarefresh/fetch.php [root@share simplesamlphp-1.14.11]# ls -l metadata/metadata-fedelocale-consuming/ total 2592 -rw-r--r-- 1 apache apache 67318 20 févr. 08:37 attributeauthority-remote.php -rw-r--r-- 1 apache apache 275713 20 févr. 08:37 saml20-idp-remote.php -rw-r--r-- 1 apache apache 1037699 20 févr. 08:37 saml20-sp-remote.php -rw-r--r-- 1 apache apache 269717 20 févr. 08:37 shib13-idp-remote.php -rw-r--r-- 1 apache apache 992402 20 févr. 08:37 shib13-sp-remote.php mise a jour manuelle en cli : [root@share simplesamlphp-1.14.11]# curl --silent "https://share.tem-tsp.eu/simplesaml/module.php/cron/cron.php?key=secret&tag=hourly" [root@share simplesamlphp-1.14.11]# ls -l metadata/metadata-fedelocale-consuming/ total 2592 -rw-r--r-- 1 apache apache 67318 20 févr. 09:56 attributeauthority-remote.php -rw-r--r-- 1 apache apache 275713 20 févr. 09:56 saml20-idp-remote.php -rw-r--r-- 1 apache apache 1037699 20 févr. 09:56 saml20-sp-remote.php -rw-r--r-- 1 apache apache 269717 20 févr. 09:56 shib13-idp-remote.php -rw-r--r-- 1 apache apache 992402 20 févr. 09:56 shib13-sp-remote.php il faut s'assurer que dans config/config-metarefresh.php " le tag 'cron'=> array('hourly')," apparaisse bien dans 'allowed_tags' => array('daily', 'hourly', 'frequent'), present dans config/module_cron.php et que la clé secret 'key' => 'secret', de ce meme fichier, paramètres repris dans l'URL de téléchargement ...?key=secret&tag=hourly" . [root@share simplesaml]# cp modules/cron/config-templates/module_cron.php config [root@share simplesaml]# vim config/module_cron.php enfin 'conditionalGET' => FALSE, dans config/config-metarefresh.php permet de télécharger les metadata meme s'il n'y a pas eu de changement à la source . ==== acces authentifié ==== https://share.tem-tsp.eu/simplesaml/module.php/core/authenticate.php