Nous allons modifier le mode d'authentification de l'IdP Shibboleth : l'authentification va être déléguée à un serveur d'authentification CAS. Dans le cadre de ce tutoriel, vous utiliserez un serveur CAS de test, mais par la suite vous pourrez le connecter avec le serveur CAS de votre organisme.
Téléchargez et installez le plugin d'authentification CAS :
$> cd $> wget https://github.com/Unicon/shib-cas-authn3/archive/3.3.0.tar.gz -O shib-cas-authn3-3.3.0.tar.gz $> tar -zxf shib-cas-authn3-3.3.0.tar.gz $> sudo cp shib-cas-authn3-3.3.0/IDP_HOME/edit-webapp/no-conversation-state.jsp /opt/shibboleth-idp/edit-webapp $> wget https://github.com/Unicon/shib-cas-authn3/releases/download/3.3.0/shib-cas-authenticator-3.3.0.jar $> sudo cp shib-cas-authenticator-3.3.0.jar /opt/shibboleth-idp/edit-webapp/WEB-INF/lib/ $> wget https://repo.maven.apache.org/maven2/org/jasig/cas/client/cas-client-core/3.6.1/cas-client-core-3.6.1.jar $> sudo cp cas-client-core-3.6.1.jar /opt/shibboleth-idp/edit-webapp/WEB-INF/lib/
Modifiez le Web flow pour utiliser le plugin CAS :
**# Regular expression matching login flows to enable, e.g. IPAddress|Password** **#idp.authn.flows= Password** **idp.authn.flows = External** **# CAS Client properties (usage loosely matches that of the Java CAS Client)** **## CAS Server Properties** **shibcas.casServerUrlPrefix = https://test-cas.federation.renater.fr/cas-formation** **shibcas.casServerLoginUrl = ${shibcas.casServerUrlPrefix}/login** **## Shibboleth Server Properties** **shibcas.serverName = https://mon-poste.fr**
Activez les librairies Shibcas dans le fichier web.xml
.
Ce fichier n'étant pas par dfaut disponible dans le dossier d'édition de l'archive web (webapp), il faut commencer par le récupérer :
$> sudo cp /opt/shibboleth-idp/dist/webapp/WEB-INF/web.xml /opt/shibboleth-idp/edit-webapp/WEB-INF/
Editez à présent le fichier /opt/shibboleth-idp/edit-webapp/WEB-INF/web.xml
[...] <!-- Servlet for receiving a callback from an external CAS Server and continues the IdP login flow --> <servlet> <servlet-name>ShibCas Auth Servlet</servlet-name> <servlet-class>net.unicon.idp.externalauth.ShibcasAuthServlet</servlet-class> <load-on-startup>2</load-on-startup> </servlet> <servlet-mapping> <servlet-name>ShibCas Auth Servlet</servlet-name> <url-pattern>/Authn/External/*</url-pattern> </servlet-mapping> [...]
Reconstruire le fichier idp.war
et redémarrez le serveur Tomcat.
build.sh
commence par demander dans quelle arborescence compiler l'IdP (/opt/shibboleth-idp par défaut).
$> cd /opt/shibboleth-idp $> sudo -E ./bin/build.sh Installation Directory: [/opt/shibboleth-idp] ** APPUYER SUR ENTREE ** Rebuilding /opt/shibboleth-idp/war/idp.war ... ...done ILD SUCCESSFUL ''Total time: 14 seconds # systemctl restart tomcat
Vous pouvez à présent re-tester votre IdP en accédant à nouveau à la ressource de test https://test-sp.federation.renater.fr/.
Authentification CAS : Vous serez redirigé vers le serveur CAS de test puisque nous avons configuré notre IdP pour utiliser ce serveur CAS. Utilisez l'identifiant/mot de passe = etudiant1/etudiant1. Ce compte de test transmet un ensemble d'attributs facilitant les tests, sous réserve de configurer la diffusion de plus d'attributs au niveau de l'IdP, voir plus haut.