Comment dérouler tout le procéssus CAS à la main : ici.
Comment faire son propre Authentication Handler : ici.
Comment faire son propre thème : ici et là.
Comment mettre CAS en cluster : ici. (Sinon plus simple : CAS-Spare : site)
Comment ajouter les droits admin : Ouvrir le fichier deployerConfigContext.xml et éditer la balise suivante :
<bean id="userDetailsService" class="org.acegisecurity.userdetails.memory.InMemoryDaoImpl">
<property name="userMap">
<value>
pascoual=notused,ROLE_ADMIN
</value>
</property>
</bean>
Comment ajouter un nouveau message d'erreur :
- Ajouter au cas-server-core-3.1.1.jar la class compilée :
org.jasig.cas.authentication.handler.TestAuthenticationException
copiée d'une autre classe exception du même genre - Changer son attribut CODE en quelqque chose comme :
private static final String CODE = "error.authentication.credentials.test"; - Ajouter le CODE utilisé (ici "error.authentication.credentials.test") dans tous les fichiers WEB-INF/Classes/messages* avec le message souhaité, exemple :
error.authentication.credentials.test=Vous avez échoué 3 fois, merci d'attendre 5 minutes avant votre prochain essai. - Il reste à lancer cette erreur dans l'AuthenticationHandler que vous aurez créé.
- il suffit de copier la class org.jasig.cas.authentication.handler.support.SimpleTestUsernamePasswordAuthenticationHandler pour obtenir une class comme org.jasig.cas.authentication.handler.support.TestErrorAuthenticationHandler :
public final class TestErrorAuthenticationHandler extends
AbstractUsernamePasswordAuthenticationHandler {
public TestErrorAuthenticationHandler() {
}
public boolean authenticateUsernamePasswordInternal(
final UsernamePasswordCredentials credentials)
throws AuthenticationException {
throw new TestAuthenticationException ();
}
} - modifier le fichier WEB-INF\deployerConfigContext.xml avec le nouveau authentication handler créé :
<bean class="org.jasig.cas.authentication.handler.support.TestErrorAuthenticationHandler" /> - Lancer le serveur et essayez de vous logger
http://www.ja-sig.org/wiki/display/CASUM/Services+Management
- Modifier le fichier WEB-INF/deployerConfigContext.xml afin d'y ajouter le ou les utilisateur administrateur. Ex :
<bean id="userDetailsService" class="org.acegisecurity.userdetails.memory.InMemoryDaoImpl">
<property name="userMap">
<value>
admin=notused,ROLE_ADMIN
</value>
</property>
</bean> - Aller sur la page .../cas/services/ l'interface d'administration est là.
- Le premier service à ajouter est l'interface d'administration .../cas/services/*
Changement de mot de pass au bout de X mois :
- Créer une AuthenticationHandler (expliquer au dessus) et ajouter un message contenant un lien vers le site qui permet de changer le mot de pass.- Sinon il y a aussi ça qui pour une complexité supérieure a le même rendu pour l'utilisateur => bof donc.
Quelle est la durée de vie par défaut de :
- TGT/TGC : 2 heures (CAS 2.X : configurable via edu.yale.its.tp.cas.grantingTimeout).
- ST : 300 secondes (CAS 2.X : configurable via edu.yale.its.tp.cas.serviceTimeout).
- PGT : je n'ai pas trouvé, certainement identique au TGT.
- PT : 300 secondes (CAS 2.X : configurable via edu.yale.its.tp.cas.serviceTimeout).
CAS 2.X => Exemple de fichier web.xml de configuration du serveur CAS.
CAS 3.X => Configurable dans le fichier /WEB-INF/spring-configuration/ticketExpirationPolicies.xml
L'algorithme de génération des tickets utilise la fonction SecureRandom() de JAVA comme vous pouvez le lire dans la class DefaultRandomStringGenerator de CAS (JavaDoc).
Les logs d’utilisation sont configurables pour afficher les accès à CAS (cas\WEB-INF\classes\log4j.properties). Ceci donne dans le cas d'une connexion de l'utilisateur pp sur le site http://localhost/bling qui lui même va se connecter en mode proxy sur http://localhost/bongo/ :
2007-11-27 12:27:56,984 INFO [org.jasig.cas.authentication.AuthenticationManagerImpl] - <AuthenticationHandler: org.jasig.cas.authentication.handler.support.SimpleTestUsernamePasswordAuthenticationHandler successfully authenticated the user which provided the following credentials: pp>
2007-11-27 12:27:56,984 INFO [org.jasig.cas.CentralAuthenticationServiceImpl] - <Granted service ticket [ST-1-zt79jsaXTuXdtfe4tdX0] for service [http://localhost/bling] for user [pp]>
2007-11-27 12:29:32,984 INFO [org.jasig.cas.authentication.AuthenticationManagerImpl] - <AuthenticationHandler: org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler successfully authenticated the user which provided the following credentials: https://localhost/bling/pgtCallBack/>
2007-11-27 12:34:41,218 INFO [org.jasig.cas.CentralAuthenticationServiceImpl] - <Granted service ticket [ST-2-aP3vaMJLZ7yrRcTei1NO] for service [http://localhost/bongo] for user [https://localhost/bling/pgtCallBack]>
Pour contruire le projet sous eclipse c'est ici (http://www.ja-sig.org/wiki/display/CASUM/Using+CAS+with+Maven+2+and+Eclipse).
Pour que tests de maven passent, il ne faut pas d'espace dans le path du projet eclipse !!!
Tags : CAS SSO Informatique
Pages ayant pour tag : cas
- cas : CAS : une solution SSO
