Comparaison des versions

Légende

  • Ces lignes ont été ajoutées. Ce mot a été ajouté.
  • Ces lignes ont été supprimées. Ce mot a été supprimé.
  • La mise en forme a été modifiée.

...

Configuration de Kerberos

Procéder comme vu précédemment pour générer Editer le fichier /etc/http.keytab qui sera utilisé ultérieurement par la librairie JCIFS krb5.conf pour intégrer le serveur au domaine Kerberos :

Bloc de code
[logging]
 default = FILE:/var/log/krb5libs.log
 kdc = FILE:/var/log/krb5kdc.log
 admin_server = FILE:/var/log/kadmind.log

[libdefaults]
 default_realm = UNIV-RENNES1.FR
 dns_lookup_realm = false
 dns_lookup_kdc = false
 ticket_lifetime = 24h
 forwardable = yes

[realms]
 UNIV-RENNES1.FR = {
  kdc = kerb1.univ-rennes1.fr:88
  admin_server = kerb1.univ-rennes1.fr:749
  default_domain = univ-rennes1.fr
 }

[domain_realm]
 .univ-rennes1.fr = UNIV-RENNES1.FR
 univ-rennes1.fr = UNIV-RENNES1.FR

[appdefaults]
 pam = {
   debug = false
   ticket_lifetime = 36000
   renew_lifetime = 36000
   forwardable = true
   krb4_convert = false
 }

Ajouter le principal HTTP/cas-kerb.univ-rennes1.fr (casse importante) au royaume et l'exporter dans le fichier /etc/http.keytab :

Bloc de code
[root@cas-kerb ~]# kadmin
Authenticating as principal rootifsic/admin@UNIV-RENNES1.FR with password.
kadmin: Client not found in Kerberos database while initializing kadmin interface
[rootifsic@cas-kerb ~]# kadmin -p root/admin
Authenticating as principal root/admin with password.
Password for root/admin@UNIV-RENNES1.FR:
kadmin:  addprinc -randkey HTTP/cas-kerb.univ-rennes1.fr
WARNING: no policy specified for HTTP/cas-kerb.univ-rennes1.fr@UNIV-RENNES1.FR; defaulting to no policy
Principal "HTTP/cas-kerb.univ-rennes1.fr@UNIV-RENNES1.FR" created.
kadmin:  ktadd -k /etc/http.keytab HTTP/cas-kerb.univ-rennes1.frroot@cas ~]# kadmin
Authenticating as principal root/admin@UNIV-RENNES1.FR with password.
Password for root/admin@UNIV-RENNES1.FR:
kadmin:  ktadd -k /etc/http.keytab HTTP/cas.ifsic.univ-rennes1.fr
Entry for principal HTTP/cas.ifsic.univ-rennes1.fr with kvno 3, encryption type AES-256 CTS mode with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/http.keytab.
Entry for principal HTTP/cas.ifsic.univ-rennes1.fr with kvno 3, encryption type AES-128 CTS mode with 96-bit SHA-1 HMAC added to keytab WRFILE:/etc/http.keytab.
Entry for principal HTTP/cas-kerb.ifsic.univ-rennes1.fr with kvno 3, encryption type Triple DES cbc mode with HMAC/sha1 added to keytab WRFILE:/etc/http.keytab.
Entry for principal HTTP/cas-kerb.ifsic.univ-rennes1.fr with kvno 3, encryption type ArcFour with HMAC/md5 added to keytab WRFILE:/etc/http.keytab.
Entry for principal HTTP/cas.ifsic-kerb.univ-rennes1.fr with kvno 3, encryption type DES with HMAC/sha1 added to keytab WRFILE:/etc/http.keytab.
Entry for principal HTTP/cas.ifsic-kerb.univ-rennes1.fr with kvno 3, encryption type DES cbc mode with RSA-MD5 added to keytab WRFILE:/etc/http.keytab.
kadmin:  exit
[root@cas ~][root@cas-kerb ~]#

Le fichier /etc/http.keytab sera utilisé par la librairie JCIFS.

Configuration de CAS

Ajouter le support du handler spnego

Editer le fichier <cas-home>/cas-server-webapp/pom.xml et ajouter la dépendance suivante (par exemple juste après la dépendance vers le module cas-server-support-ldap) :

...

Modifier le login webflow

Editer le fichier <cas-home>/cas-server-webapp/src/main/webapp/WEB-INF/login-webflow.xml et ajouter l'état suivant juste avant l'état viewLoginForm :

...

Déclarer le bean implémentant le nouvel état du webflow en ajoutant les lignes suivantes dans le fichier <cas-home>/cas-server-webapp/src/main/webapp/WEB-INF/cas-servlet.xml (par exemple juste avant le bean authenticationViaFormAction) :

...

Pour modifier le schéma d'authentification, éditer le fichier <cas-home>/cas-server-webapp/src/main/webapp/WEB-INF/deployerConfigContext.xml et modifier le bean authenticationManager en ajoutant :

...

Bloc de code
<bean name="jcifsConfig" class="org.jasig.cas.support.spnego.authentication.handler.support.JCIFSConfig">
  <property
      name="jcifsServicePrincipal"
      value="HTTP/cas.ifsic.univ-rennes1.fr" />
  <property
      name="kerberosDebug"
      value="true" />
  <property
      name="kerberosRealm"
      value="UNIV-RENNES1.FR" />
  <property
      name="kerberosKdc"
      value="kerb.ifsic.univ-rennes1.fr" />
  <property
      name="loginConf"
      value="/usr/local/cas-server-3.3.5/cas-server-webapp/src/main/webapp/WEB-INFetc/jcifs/login.conf" />

Configuration de JCIFS

...