Shibboleth est un mécanisme de fédération d'identités, développé par le consortium Internet2, qui regroupe 207 universités et centres de recherches.
Maarch Courrier offre la possibilité de passer par Shibboleth pour gérer l'authentification.
Voici une description des services de la suite logicielle Shibboleth :
https://www.projet-plume.org/fiche/shibboleth
Utiliser l'installation RPM
https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPLinuxRPMInstall
yum install mod_ssl
wget http://download.opensuse.org/repositories/security://shibboleth/CentOS_7/x86_64/libcurl-openssl-7.61.0-1.1.x86_64.rpm
rpm -Uvh libcurl-openssl-7.61.0-1.1.x86_64.rpm
wget http://download.opensuse.org/repositories/security://shibboleth/CentOS_7/x86_64/liblog4shib2-2.0.0-3.1.x86_64.rpm
rpm -Uvh liblog4shib2-2.0.0-3.1.x86_64.rpm
yum install libmemcached
wget https://rpmfind.net/linux/centos/7.5.1804/os/x86_64/Packages/libtool-ltdl-2.4.2-22.el7_3.x86_64.rpm
rpm -Uvh libtool-ltdl-2.4.2-22.el7_3.x86_64.rpm
wget https://rpmfind.net/linux/centos/7.5.1804/os/x86_64/Packages/unixODBC-2.3.1-11.el7.x86_64.rpm
rpm -Uvh unixODBC-2.3.1-11.el7.x86_64.rpm
wget http://download.opensuse.org/repositories/security://shibboleth/CentOS_7/x86_64/libxerces-c-3_2-3.2.1-1.1.x86_64.rpm
rpm -Uvh libxerces-c-3_2-3.2.1-1.1.x86_64.rpm
wget http://download.opensuse.org/repositories/security://shibboleth/CentOS_7/x86_64/libxml-security-c20-2.0.1-3.1.x86_64.rpm
rpm -Uvh libxml-security-c20-2.0.1-3.1.x86_64.rpm
wget http://download.opensuse.org/repositories/security://shibboleth/CentOS_7/x86_64/libxmltooling8-3.0.2-3.1.x86_64.rpm
rpm -Uvh libxmltooling8-3.0.2-3.1.x86_64.rpm
wget http://download.opensuse.org/repositories/security://shibboleth/CentOS_7/x86_64/libsaml10-3.0.0-1.1.x86_64.rpm
rpm -Uvh libsaml10-3.0.0-1.1.x86_64.rpm
wget http://download.opensuse.org/repositories/security://shibboleth/CentOS_7/x86_64/opensaml-schemas-3.0.0-1.1.x86_64.rpm
rpm -Uvh opensaml-schemas-3.0.0-1.1.x86_64.rpm
wget http://download.opensuse.org/repositories/security://shibboleth/CentOS_7/x86_64/xmltooling-schemas-3.0.2-3.1.x86_64.rpm
rpm -Uvh xmltooling-schemas-3.0.2-3.1.x86_64.rpm
wget http://download.opensuse.org/repositories/security://shibboleth/CentOS_7/x86_64/shibboleth-3.0.2-1.1.x86_64.rpm
rpm -Uvh shibboleth-3.0.2-1.1.x86_64.rpm
Les fichiers de configuration de Shibboleth seront placés dans /etc/shibboleth/ et la configuration Apache requise dans /etc/httpd/conf.d/shib.conf shibd sera installé dans /usr/sbin et peut être géré à l'aide du service et chkconfig (sur les plates-formes System V) ou avec systemctl (sur les plates-formes systemd, certaines informations supplémentaires sont disponibles).
Une version appropriée de mod_shib et d'autres modules pluggables sera installée dans /usr/lib/shibboleth/ sur un système d'exploitation 32 bits et /usr/lib64/shibboleth sur un système d'exploitation 64 bits.
Dans httpd.conf, l'utilisation de la fonctionnalité RequestMap n'est pas recommandée avec Apache, mais son utilisation nécessite que la directive UseCanonicalName soit définie. Assurez-vous que la directive ServerName est correctement définie et qu’Apache est en cours de démarrage avec SSL activé. Redémarrez Apache.
/usr/sbin/shibd doit être démarré et exécuté indépendamment pour traiter les demandes. Le démon doit être chargé et surveillé avec tous les autres services principaux.
/sbin/service shibd start
Par défaut, le module Shibboleth est configuré pour enregistrer les informations de la part d’Apache dans /var/log/shibboleth-www/native.log. shibd crée ses propres journaux séparés dans/var/log/shibboleth
Vérification de la configuration de shibboleth
shibd -t
Le plus Important est que la dernière ligne de la sortie soit :
"overall configuration is loadable, check console for non-fatal problems"
voir l'exemple :
suivre à partir du chapitre 2.3 : https://services.renater.fr/federation/docs/installation/sp_juin2012
nano /etc/httpd/conf.d/shib.conf
# https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPApacheConfig
# RPM installations on platforms with a conf.d directory will
# result in this file being copied into that directory for you
# and preserved across upgrades.
# For non-RPM installs, you should copy the relevant contents of
# this file to a configuration location you control.
#
# Load the Shibboleth module.
#
LoadModule mod_shib /usr/lib64/shibboleth/mod_shib_24.so
#
# Turn this on to support "require valid-user" rules from other
# mod_authn_* modules, and use "require shib-session" for anonymous
# session-based authorization in mod_shib.
#
ShibCompatValidUser Off
#
# Ensures handler will be accessible.
#
<Location /Shibboleth.sso>
AuthType None
Require all granted
</Location>
#
# Used for example style sheet in error templates.
#
<IfModule mod_alias.c>
<Location /shibboleth-sp>
AuthType None
Require all granted
</Location>
Alias /shibboleth-sp/main.css /usr/share/shibboleth/main.css
</IfModule>
#
# Configure the module for content.
#
# You MUST enable AuthType shibboleth for the module to process
# any requests, and there MUST be a require command as well. To
# enable Shibboleth but not specify any session/access requirements
# use "require shibboleth".
#
<Directory "/var/www/html/MaarchCourrier/cs_cd65/">
AuthType shibboleth
ShibRequestSetting requireSession 1
ShibRequestSetting applicationId default
require shib-session
AllowOverride All
Options -Indexes
Options FollowSymLinks Includes ExecCGI
<FilesMatch ".*">
Order deny,allow
Deny from all
</FilesMatch>
# Root to allow index.php
<FilesMatch "^$">
Order allow,deny
Allow from all
</FilesMatch>
# Core root
<FilesMatch "^(index|ws_server|static|merged_js|merged_css|reopen|applet_launcher|applet_controller|log)\.php$">
Order allow,deny
Allow from all
</FilesMatch>
# App static files
<FilesMatch "\.(css|js|jpg|jpeg|png|gif|ttf|woff|woff2)$">
Order allow,deny
Allow from all
</FilesMatch>
# App tools files
<FilesMatch "\.(htm|html|jar|jnlp)$">
Order allow,deny
Allow from all
</FilesMatch>
</Directory>
# Activation globale de l'authentification Shibboleth pour toutes les routes
# a ne pas activer pour l'édition de doc
# <Location />
# AuthType shibboleth
# Require shibboleth
# </Location>
# Pour l'édition de documents, pas d'authent shibboleth
<Directory /var/www/html/MaarchCourrier/modules/content_management/dist>
Satisfy Any
Allow from all
AuthType None
Require all granted
</Directory>
<Directory /var/www/html/MaarchCourrier/apps/maarch_entreprise/tmp/*.jnlp>
Satisfy Any
Allow from all
AuthType None
Require all granted
</Directory>
<Location /MaarchCourrier/cs_cd65/rest/>
Satisfy Any
Allow from all
AuthType None
Require all granted
</Location>
SetEnv MAARCH_TMP_DIR "/tmp"
<Directory /tmp/*.jnlp>
Satisfy Any
Allow from all
AuthType None
Require all granted
</Directory>
/etc/shibboleth/shibboleth2.xml
<SPConfig xmlns="urn:mace:shibboleth:3.0:native:sp:config"
xmlns:conf="urn:mace:shibboleth:3.0:native:sp:config"
clockSkew="180">
<OutOfProcess tranLogFormat="%u|%s|%IDP|%i|%ac|%t|%attr|%n|%b|%E|%S|%SS|%L|%UA|%a" />
<ApplicationDefaults entityID="https://92.243.8.134"
REMOTE_USER="eppn subject-id pairwise-id persistent-id"
cipherSuites="DEFAULT:!EXP:!LOW:!aNULL:!eNULL:!DES:!IDEA:!SEED:!RC4:!3DES:!kRSA:!SSLv2:!SSLv3:!TLSv1:!TLSv1.1">
<Sessions lifetime="28800" timeout="3600" relayState="ss:mem"
checkAddress="false" handlerSSL="true" cookieProps="https">
<SSO discoveryProtocol="SAMLDS" discoveryURL="https://discovery.renater.fr/test">
SAML2 SAML1
</SSO>
<Logout>SAML2 Local</Logout>
<LogoutInitiator type="Admin" Location="/Logout/Admin" acl="127.0.0.1 ::1" />
<Handler type="MetadataGenerator" Location="/Metadata" signing="false"/>
<Handler type="Status" Location="/Status" acl="127.0.0.1 ::1"/>
<Handler type="Session" Location="/Session" showAttributeValues="false"/>
<Handler type="DiscoveryFeed" Location="/DiscoFeed"/>
</Sessions>
<Errors supportContact="root@localhost"
metadata="metadataError_fr.html"
access="accessError_fr.html"
ssl="sslError_fr.html"
localLogout="localLogout_fr.html"
globalLogout="globalLogout_fr.html"
logoLocation="/shibboleth-sp/logo.jpg"
styleSheet="/shibboleth-sp/main.css"/>
<!-- Meta-données de la fédération de Test RENATER -->
<MetadataProvider type="XML" url="https://metadata.federation.renater.fr/test/preview/preview-all-renater-test-metadata.xml"
backingFilePath="preview-all-renater-test-metadata.xml" reloadInterval="7200">
<MetadataFilter type="Signature" certificate="renater-metadata-signing-cert-2016.pem"/>
</MetadataProvider>
<AttributeExtractor type="XML" validate="true" reloadChanges="false" path="attribute-map.xml"/>
<AttributeFilter type="XML" validate="true" path="attribute-policy.xml"/>
<CredentialResolver type="File" use="signing"
key="sp-signing-key.pem" certificate="sp-signing-cert.pem"/>
<CredentialResolver type="File" use="encryption"
key="sp-encrypt-key.pem" certificate="sp-encrypt-cert.pem"/>
<CredentialResolver type="File" key="sp-key.pem" certificate="sp-cert.pem" />
</ApplicationDefaults>
<SecurityPolicyProvider type="XML" validate="true" path="security-policy.xml"/>
<ProtocolProvider type="XML" validate="true" reloadChanges="false" path="protocols.xml"/>
</SPConfig>
nano apps/maarch_entreprise/xml/login_method.xml
<METHOD>
<ID>shibboleth</ID>
<NAME>Shibboleth</NAME>
<SCRIPT>shibbolethConnect.php</SCRIPT>
<ENABLED>true</ENABLED>
</METHOD>