Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Introduction

L'installation d' ESUP-SGC au sein de le COMUE Normandie Université nécessite une configuration spécifique notamment au niveau des applications Desfire écrites sur la carte, du paramétrage CROUS et du contrôle d'acces.

Dans ce document on donne la structure des fichiers de configuration à titre d'exemple et sans les clés confidentielles.

Configuration ESUP-NFC-TAG-SERVER

src/main/resources/META-INF/spring/applicationContext-custom.xml

Comprenant toutes les applications optionnelles ESUP-SGC

    <bean id="dummyExtApi" class="org.esupportail.nfctag.service.api.impl.AppliExtDummy"/>
    
    <bean id="tagIdCheckApiLdap" class="org.esupportail.nfctag.service.api.impl.TagIdCheckLdap">
    	<property name="desfireSuffix" value="univ-ville.fr"/>
	<property name="description" value="via LDAP"/>
    </bean>
    <bean id="tagIdCheckApiDummy" class="org.esupportail.nfctag.service.api.impl.TagIdCheckDummyWs">
    	<property name="description" value="TagIdCheckDummy"/>
    </bean>
    <bean id="csnAuthConfig" class="org.esupportail.nfctag.service.api.impl.CsnAuthConfig">
    	<property name="description" value="Authentification CSN"/>
    </bean>
    <bean id="ldapContextSourceUnivville" class="org.springframework.ldap.core.support.LdapContextSource">
	<property name="url" value="ldap://ldap.univ-ville.fr" />
	<property name="base" value="dc=univ-ville,dc=fr" />
	<property name="userDn" value="cn=admin,dc=univ-ville,dc=fr" />
	<property name="password" value="XXXXXXXX" />
    </bean>    
    <bean id="ldapTemplateUnivville" class="org.springframework.ldap.core.LdapTemplate">  
    	<constructor-arg ref="ldapContextSourceUnivville" />  
    </bean>
    <bean id="ldapServiceUnivville" class="org.esupportail.nfctag.service.LdapService">
	<property name="ldapTemplate" ref="ldapTemplateUnivville" />
    </bean> 
    <bean id="esupSgcExtApi" class="org.esupportail.nfctag.service.api.impl.AppliExtRestWs">
    	<property name="isTagableUrl" value="https://esup-sgc.univ-ville.fr/wsrest/nfc/isTagable"/>
    	<property name="validateTagUrl" value="https://esup-sgc.univ-ville.fr/wsrest/nfc/validateTag"/>
    	<property name="getLocationsUrl" value="https://esup-sgc.univ-ville.fr/wsrest/nfc/locations"/>
    	<property name="description" value="Web Service Write Esup SGC"/>
    </bean>
    <bean id="esupSgcUpdateExtApi" class="org.esupportail.nfctag.service.api.impl.AppliExtRestWs">
        <property name="isTagableUrl" value="https://esup-sgc.univ-ville.fr/wsrest/nfc/isTagable"/>
        <property name="validateTagUrl" value="https://esup-sgc.univ-ville.fr/wsrest/nfc/validateTag"/>
        <property name="getLocationsUrl" value="https://esup-sgc.univ-ville.fr/wsrest/nfc/locationsUpdater"/>
        <property name="description" value="Web Service Update Esup SGC"/>
    </bean>
	<bean id="esupSgcSearchExtApi" class="org.esupportail.nfctag.service.api.impl.AppliExtRestWs">
        <property name="isTagableUrl" value="https://esup-sgc.univ-ville.fr/wsrest/nfc/isTagable"/>
        <property name="validateTagUrl" value="https://esup-sgc.univ-ville.fr/wsrest/nfc/validateTag"/>
        <property name="getLocationsUrl" value="https://esup-sgc.univ-ville.fr/wsrest/nfc/locationsSearch"/>
        <property name="description" value="Web Service Search Esup SGC"/>
    </bean>
    <bean id="esupSgcLivraisonExtApi" class="org.esupportail.nfctag.service.api.impl.AppliExtRestWs">
    	<property name="isTagableUrl" value="https://esup-sgc.univ-ville.fr/wsrest/nfc/isTagable"/>
    	<property name="validateTagUrl" value="https://esup-sgc.univ-ville.fr/wsrest/nfc/validateTag"/>
    	<property name="getLocationsUrl" value="https://esup-sgc.univ-ville.fr/wsrest/nfc/locationsLivreur"/>
    	<property name="description" value="Web Service livraison Esup SGC"/>
    </bean>
    <bean id="esupSgcVersoExtApi" class="org.esupportail.nfctag.service.api.impl.AppliExtRestWs">
    	<property name="isTagableUrl" value="https://esup-sgc.univ-ville.fr/wsrest/nfc/isTagable"/>
    	<property name="validateTagUrl" value="https://esup-sgc.univ-ville.fr/wsrest/nfc/validateTag"/>
    	<property name="getLocationsUrl" value="https://esup-sgc.univ-ville.fr/wsrest/nfc/locationsVerso"/>
    	<property name="displayUrl" value="https://esup-sgc.univ-ville.fr/wsrest/nfc/verso"/>
    	<property name="description" value="Web Service Verso Esup SGC"/>
    </bean>
    
    <bean id="tagIdCheckApiEsupSgc" class="org.esupportail.nfctag.service.api.impl.TagIdCheckRestWs">
	<property name="tagIdCheckUrl" value="https://esup-sgc.univ-ville.fr/wsrest/nfc/tagIdCheck"/>
	<property name="idFromEppnInitUrl" value="https://esup-sgc.univ-ville.fr/wsrest/nfc/idFromEppnInit"/>
	<property name="description" value="via Esup SGC"/>
    </bean>

 

src/main/resources/META-INF/spring/applicationContext-desfire.xml

La carte doit comporter les applications leocode (F585C0) et idp2s (F585C1)

 

    <bean id="idp2sTagWriteEsupSgc" class="org.esupportail.nfctag.service.api.impl.TagWriteRestWs">
	<property name="idFromCsnUrlTemplate" value="https://esup-sgc.univ-ville.fr/wsrest/nfc/idFromCsn?csn={0}&amp;appName=access-control"/>
    </bean>
    <bean id="leocodeTagWriteEsupSgc" class="org.esupportail.nfctag.service.api.impl.TagWriteRestWs">
	<property name="idFromCsnUrlTemplate" value="https://esup-sgc.univ-ville.fr/wsrest/nfc/idFromCsn?csn={0}&amp;appName=bu"/>
    </bean>
    
    <bean id="idp2sTagUpdateEsupSgc" class="org.esupportail.nfctag.service.api.impl.TagUpdateRestWs">
	<property name="idFromCsnUrlTemplate" value="https://esup-sgc.univ-ville.fr/wsrest/nfc/idFromCsn?csn={0}&amp;appName=access-control"/>
    </bean>
    
    <bean id="dateLastUpdateEsupSgc" class="org.esupportail.nfctag.service.api.impl.TagUpdateRestWs">
	<property name="wsUrl" value="https://esup-sgc.univ-ville.fr/wsrest/nfc/lastUpdateFromCsn"/>
    </bean>
    
    <bean id="desfireComueTagEsupSgc" class="org.esupportail.nfctag.beans.DesfireTag" p:formatBeforeWrite="true" p:key="0000000000000000" p:keyType="DES" p:keyVersion="00">
 	<property name="applications">
		<util:list>
			<bean class="org.esupportail.nfctag.beans.DesfireApplication"
				p:desfireAppId="F585C0" p:amks="0B" p:nok="84">
				<property name="files">
					<util:list>
						<bean class="org.esupportail.nfctag.beans.DesfireFile"
							p:fileNumber="00" p:communicationSettings="03" p:accessRights="1223" p:fileSize="1F0000" p:tagWriteApi-ref="leocodeTagWriteEsupSgc"/>
					</util:list>
				</property>
				<property name="keys">
					<util:list>
						<bean class="org.esupportail.nfctag.beans.DesfireKey"
							p:keyNo="00" p:keyVer="01" p:type="AES" p:key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"/>
						<bean class="org.esupportail.nfctag.beans.DesfireKey"
							p:keyNo="01" p:keyVer="01" p:type="AES" p:key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"/>
						<bean class="org.esupportail.nfctag.beans.DesfireKey"
							p:keyNo="02" p:keyVer="01" p:type="AES" p:key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"/>
						<bean class="org.esupportail.nfctag.beans.DesfireKey"
							p:keyNo="03" p:keyVer="01" p:type="AES" p:key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"/>
					</util:list>
				</property>
			</bean>
			<bean class="org.esupportail.nfctag.beans.DesfireApplication"
				p:desfireAppId="F585C1" p:amks="0B" p:nok="85">
				<property name="files">
					<util:list>
						<bean class="org.esupportail.nfctag.beans.DesfireFile"
							p:fileNumber="00" p:communicationSettings="03" p:accessRights="1444" p:fileSize="1F0000" p:tagWriteApi-ref="idp2sTagWriteEsupSgc"/>
						<bean class="org.esupportail.nfctag.beans.DesfireFile"
							p:fileNumber="01" p:communicationSettings="03" p:accessRights="2444" p:fileSize="1F0000" p:tagWriteApi-ref="idp2sTagWriteEsupSgc"/>
						<bean class="org.esupportail.nfctag.beans.DesfireFile"
							p:fileNumber="02" p:communicationSettings="03" p:accessRights="3444" p:fileSize="1F0000" p:tagWriteApi-ref="idp2sTagWriteEsupSgc"/>
					</util:list>
				</property>
				<property name="keys">
					<util:list>
						<bean class="org.esupportail.nfctag.beans.DesfireKey"
							p:keyNo="00" p:keyVer="01" p:type="AES" p:key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"/>
						<bean class="org.esupportail.nfctag.beans.DesfireKey"
							p:keyNo="01" p:keyVer="01" p:type="AES" p:key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"/>
						<bean class="org.esupportail.nfctag.beans.DesfireKey"
							p:keyNo="02" p:keyVer="01" p:type="AES" p:key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"/>
						<bean class="org.esupportail.nfctag.beans.DesfireKey"
							p:keyNo="03" p:keyVer="01" p:type="AES" p:key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"/>		
						<bean class="org.esupportail.nfctag.beans.DesfireKey"
							p:keyNo="04" p:keyVer="01" p:type="AES" p:key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"/>	
					</util:list>
				</property>
			</bean>
		</util:list>
	</property>
    </bean>

    <bean id="desfireAuthConfigComueWriteEsupSgc" class="org.esupportail.nfctag.service.api.impl.DesfireWriteConfig">
	<property name="desfireTag" ref="desfireComueTagEsupSgc" />
	<property name="description" value="Ecriture ESUP SGC"/>
    </bean>
    <bean id="desfireComueTagUpdateEsupSgc" class="org.esupportail.nfctag.beans.DesfireTag" p:formatBeforeWrite="false" p:key="0000000000000000" p:keyType="DES" p:keyVersion="00">
	<property name="applications">
		<util:list>
			<bean class="org.esupportail.nfctag.beans.DesfireApplication"
				p:desfireAppId="F585C1" p:amks="0B" p:nok="85" p:updateDate="2016-03-01 12:00" p:tagUpdateApi-ref="dateLastUpdateEsupSgc">
				<property name="files">
					<util:list>
						<bean class="org.esupportail.nfctag.beans.DesfireFile"
							p:fileNumber="00" p:communicationSettings="03" p:accessRights="1444" p:fileSize="1F0000" p:tagUpdateApi-ref="idp2sTagUpdateEsupSgc"/>
						<bean class="org.esupportail.nfctag.beans.DesfireFile"
							p:fileNumber="01" p:communicationSettings="03" p:accessRights="2444" p:fileSize="1F0000" p:tagUpdateApi-ref="idp2sTagUpdateEsupSgc"/>
						<bean class="org.esupportail.nfctag.beans.DesfireFile"
							p:fileNumber="02" p:communicationSettings="03" p:accessRights="3444" p:fileSize="1F0000" p:tagUpdateApi-ref="idp2sTagUpdateEsupSgc"/>
					</util:list>
				</property>
				<property name="keys">
					<util:list>
						<bean class="org.esupportail.nfctag.beans.DesfireKey"
							p:keyNo="00" p:keyVer="01" p:type="AES" p:key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"/>
						<bean class="org.esupportail.nfctag.beans.DesfireKey"
							p:keyNo="01" p:keyVer="01" p:type="AES" p:key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"/>
						<bean class="org.esupportail.nfctag.beans.DesfireKey"
							p:keyNo="02" p:keyVer="01" p:type="AES" p:key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"/>
						<bean class="org.esupportail.nfctag.beans.DesfireKey"
							p:keyNo="03" p:keyVer="01" p:type="AES" p:key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"/>		
						<bean class="org.esupportail.nfctag.beans.DesfireKey"
							p:keyNo="04" p:keyVer="01" p:type="AES" p:key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"/>	
					</util:list>
				</property>
			</bean>
		</util:list>
	</property>
    </bean>
    <bean id="desfireAuthConfigComueUpdateEsupSgc" class="org.esupportail.nfctag.service.api.impl.DesfireUpdateConfig">
	<property name="desfireTag" ref="desfireComueTagUpdateEsupSgc" />
	<property name="description" value="Mise à jour ESUP SGC"/>
    </bean>

Configuration ESUP-SGC

src/main/resources/META-INF/spring/applicationContext-services.xml

	<bean id="shibUserInfoService" class="org.esupportail.sgc.services.userinfos.ShibUserInfoService" p:order="1">
		<property name="sgcParam2requestHeader">
			<map>
				<entry key="email" value="mail"/>
				<entry key="firstname" value="givenname"/>
				<entry key="name" value="sn"/>
				<entry key="eduPersonPrimaryAffiliation" value="eduPersonPrimaryAffiliation"/>
				<entry key="supannEtuId" value="supannEtuId"/>
				<entry key="supannEmpId" value="supannEmpId"/>
				<entry key="supannEtuEtape" value="supannEtuEtape"/>
				<entry key="supannEntiteAffectationPrincipale" value="supannEntiteAffectationPrincipale"/>
				<entry key="supannEtablissement" value="supannEtablissement"/>
				<entry key="supannCodeINE" value="supannCodeINE"/>
				<entry key="schacDateOfBirth" value="schacDateOfBirth"/>
				<entry key="recto2" value="givenname"/>
				<entry key="recto3" value="sn"/>
			</map>
		</property>	
	</bean>
	
	<bean id="ldapContextSourcePool" class="org.springframework.ldap.pool.factory.PoolingContextSource">
		<property name="contextSource" ref="ldapContextSource" />
		<property name="dirContextValidator" ref="dirContextValidator"/>
		<property name="testWhileIdle" value="true"/>
		<property name="testOnBorrow" value="true"/>
	</bean>
   
	<bean id="dirContextValidator"
	 class="org.springframework.ldap.pool.validation.DefaultDirContextValidator" />
	
	<bean id="ldapContextSource"
		class="org.springframework.ldap.core.support.LdapContextSource">
		<property name="url" value="ldap://ldap.univ-ville.fr" />
		<property name="base" value="dc=univ-ville,dc=fr" />
		<property name="userDn" value="cn=admin,dc=univ-ville,dc=fr" />
		<property name="password" value="XXXXXXXX" />
	</bean>    
	
	<bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate">
		<constructor-arg ref="ldapContextSourcePool" />
	</bean>
	
	<bean id="ldapUserInfoService" class="org.esupportail.sgc.services.userinfos.LdapUserInfoService" p:order="2">
		<property name="eppnFilter" value=".*@univ-ville.fr"/>
		<property name="ldapTemplate" ref="ldapTemplate"/>
		<property name="sgcParam2ldapAttr">
			<map>
				<entry key="email" value="mail"/>
				<entry key="eduPersonPrimaryAffiliation" value="eduPersonPrimaryAffiliation"/>
				<entry key="supannEtuId" value="supannEtuId"/>
				<entry key="supannEmpId" value="supannEmpId"/>
				<entry key="supannCodeINE" value="supannCodeINE"/>
				<entry key="supannEntiteAffectationPrincipale" value="supannEntiteAffectationPrincipale"/>
				<entry key="firstname" value="givenname"/>
				<entry key="name" value="sn"/>
				<entry key="schacDateOfBirth" value="schacDateOfBirth"/>
				<entry key="supannEtablissement" value="supannEtablissement"/>
				<entry key="supannRefId4ExternalCard" value="supannRefId"/>
				<entry key="jpegPhoto4ExternalCard" value="jpegPhoto"/>
				<entry key="recto3" value="givenname"/>
				<entry key="recto2" value="sn"/>
				<entry key="schacExpiryDate" value="schacExpiryDate"/>
				<entry key="secondaryId" value="eduPersonPrincipalName"/>
			</map>
		</property>	
	</bean>
	
	<bean id="groupService" class="org.esupportail.sgc.services.ldap.LdapGroupService">
		<property name="ldapTemplate" ref="ldapTemplate"/>
		<property name="groupSearchBase" value="ou=groups" />
		<property name="groupSearchFilter" value="member={0}"/>
		<property name="memberSearchBase" value="ou=people"/>
		<property name="memberSearchFilter" value="memberOf={0}"/>
	</bean>
	<!--
	Exemple de sqlUserInfoService. Recupécation des informations utilisateur via une requete SQL
	-->

	<bean class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" id="mysqlDataSource">
		<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
		<property name="url" value="jdbc:mysql://mysql.univ-ville.fr:3306/database"/>
		<property name="username" value="admin"/>
		<property name="password" value="xxxxxxxx"/>
		<property name="testOnBorrow" value="true" />
		<property name="testOnReturn" value="true" />
		<property name="testWhileIdle" value="true" />
		<property name="timeBetweenEvictionRunsMillis" value="1800000" />
		<property name="numTestsPerEvictionRun" value="3" />
		<property name="minEvictableIdleTimeMillis" value="1800000" />
		<property name="validationQuery" value="SELECT version();" />
	</bean>
	
	<bean id="univvilleUserInfoService" class="org.esupportail.sgc.services.userinfos.SqlUserInfoService" p:order="3">
		<property name="eppnFilter" value=".*@univ-ville.fr"/>
		<property name="dataSource" ref="mysqlDataSource"/>
		<property name="sqlQuery" value="select ligneTitre as recto1,
			nom as recto2,
			prenom as recto3,
			dateNaissance as recto4,
			identifiant as recto5,
			ligneAnneeUniv as recto7,
			divers1 as verso1,
			divers2 as verso2,
			divers3 as verso3,
			divers4 as verso4,
			anneeUniv as verso5,
			typepopulationcrous as referenceStatut,
			indiceinm as indice,
			concat(replace(datefindroits,'-',''),'235959Z') as schacExpiryDate,
			leocode as secondaryId,
			adresseFilterLibelle as address
			from SgcLeoCarte where eppn=?"/>
	</bean>
	
	<!-- 
	On s'assure que eduPersonPrimaryAffiliation est conservé
	On fait également en sorte de toujours conserver une email, même si celui-ci n'est plus valide : le crous exige qu'un compte ait toujours un email de présent
	-->
	<bean id="spelUserInfoServiceEPPA" class="org.esupportail.sgc.services.userinfos.SpelUserInfoService" p:order="4">
		<property name="sgcParam2spelExp">
			<map>
				<entry key="eduPersonPrimaryAffiliation" value="#userInfosInComputing['eduPersonPrimaryAffiliation'] == Null or #userInfosInComputing['eduPersonPrimaryAffiliation'] == '' ? 
							#user.eduPersonPrimaryAffiliation : #userInfosInComputing['eduPersonPrimaryAffiliation'] "/>
				<entry key="email" value="#userInfosInComputing['email'] != Null and #userInfosInComputing['email'] matches '.*@.*' ? #userInfosInComputing['email'] : #user.email"/>
			</map>
		</property>	
	</bean>
	
	<!-- 
	On calcule l'institute en fonction de l'eppn
	On calcule le userType en fonction de eduPersonPrimaryAffiliation
	On calcule le template de la carte en fonction de l'eppn
	-->
	<bean id="spelUserInfoService" class="org.esupportail.sgc.services.userinfos.SpelUserInfoService" p:order="5">
		<property name="sgcParam2spelExp">
			<map>
				<entry key="institute" value="#user.eppn matches '.*@univ-ville.fr' ? 'Université de ville' : 'Extérieur'"/>
				<entry key="userType" value="!(#user.eppn matches '.*@univ-ville.fr') ? 'Ext' : 
					#userInfosInComputing['eduPersonPrimaryAffiliation'] == 'student' ? 'E' : 
					#userInfosInComputing['eduPersonPrimaryAffiliation'] == 'staff' or #userInfosInComputing['eduPersonPrimaryAffiliation'] == 'teacher' or #userInfosInComputing['eduPersonPrimaryAffiliation'] == 'employee' ? 'P' : 'I'"/>
				<entry key="template" value="#user.eppn matches '.*@univ-ville.fr' ? 'univ-ville' : 'undefined'"/>
			</map>
		</property>	
	</bean>
	
	<!-- 
	Si recto1 et recot4 non trouvé (dans la Base de Données ici) on les calcule en fonction du userType et de schacDateOfBirth
	on reformatte recto7 : 2017/2018 -> 2017<br/>2018 - cf propriété recto7Replace donnée dans sgc.properties
	-->
	<bean id="spelUserInfoService2" class="org.esupportail.sgc.services.userinfos.SpelUserInfoService" p:order="6">
		<property name="sgcParam2spelExp">
			<map>
				<entry key="recto1" value="#userInfosInComputing['recto1'] != Null ? #userInfosInComputing['recto1'] : 
					#userInfosInComputing['userType']  == 'E' ? 'étudiant' : 
					#userInfosInComputing['userType'] == 'P' ? 'professionnelle' : 
					#userInfosInComputing['userType'] == 'I' ? 'invité' :  
					'extérieur'"/>
				<entry key="recto4" value="#userInfosInComputing['recto4'] != Null ? #userInfosInComputing['recto4'] : 
					#userInfosInComputing['schacDateOfBirth']  != Null ? 'Né le : ' + #dateUtils.schadDateOfBirthDay2FrenchDate(#userInfosInComputing['schacDateOfBirth']) : ''"/>
				<entry key="recto7" value="${recto7Replace}"/>
			</map>
		</property>	
	</bean>
	
	<bean id="cardIdsService" class="org.esupportail.sgc.services.cardid.CardIdsService">
		<property name="cardIdServices">
			<list>
				<bean class="org.esupportail.sgc.services.cardid.ComueNuAccessControlCardIdService">
					<!-- warning : access-control is a keyword for access-control services :
						org.esupportail.sgc.services.ac.AccessControlService.AC_APP_NAME = 'access-control'
					 -->
					<property name="appName" value="access-control"/>
					<property name="idCounterBegin" value="XXXXXXXXXXXXXXXX"/>
					<property name="postgresqlSequence" value="card_sequence"/>
				</bean>
				<bean class="org.esupportail.sgc.services.cardid.ComueNuBuCardIdService">
					<property name="appName" value="bu"/>
				</bean>
				<bean class="org.esupportail.sgc.services.cardid.CnousCardIdService">
					<property name="appName" value="crous"/>
					<property name="idCounterBegin" value="XXXXXXXX"/>
					<property name="postgresqlSequence" value="crous_smart_card_sequence"/>
					<property name="crousEncodeEnabled" value="false"/>
				</bean>
			</list>
		</property>
	</bean>
	
	<bean id="esupNfcTagService" class="org.esupportail.sgc.services.EsupNfcTagService">
		<property name="restTemplate" ref="restTemplate"/>
		<property name="webUrl" value="https://esup-nfc-tag.univ-ville.fr"/>
		<property name="applicationName" value="Ecriture SGC"/>	
		<property name="location" value="Encodage ESUP SGC"/>
	</bean>
	
	<bean id="ldapAdminContextSourcePool" class="org.springframework.ldap.pool.factory.PoolingContextSource">
		<property name="contextSource" ref="ldapAdminContextSource" />
		<property name="dirContextValidator" ref="dirContextValidator"/>
		<property name="testWhileIdle" value="true"/>
		<property name="testOnBorrow" value="true"/>
	</bean>
	
	<bean id="ldapAdminContextSource"
		class="org.springframework.ldap.core.support.LdapContextSource">
		<property name="url" value="ldap://ldap.univ-ville.fr" />
		<property name="base" value="dc=univ-ville,dc=fr" />
		<property name="userDn" value="cn=admin,dc=univ-ville,dc=fr" />
		<property name="password" value="XXXXXXXX" />
	</bean>    
	
	<bean id="ldapAdminTemplate" class="org.springframework.ldap.core.LdapTemplate">
		<constructor-arg ref="ldapAdminContextSourcePool" />
	</bean>
	
	<bean id="ldapValidateService" class="org.esupportail.sgc.services.ldap.LdapValidateService">
		<property name="ldapTemplate" ref="ldapAdminTemplate"/>
		<property name="peopleSearchFilter" value="(eduPersonPrincipalName={0})"/>
		<property name="ldapCardIdsMappingMultiValues">
			<map>
				<entry key="swissEduPersonCardUID">
					<list>
						<value>%reverse_csn%@ISO15693</value>
					</list>
				</entry>
				<entry key="supannRefId">
					<list>
						<value>{ISO15693}%csn%</value>
						<value>{LEOCARTE:ACCESS-CONTROL}%access-control%</value>
					</list>
				</entry>
			</map>
		</property>
             <!-- 
		<property name="ldapCardIdsMappingValue">
			<map>
				<entry key="jpegPhoto" value="%photo%"/>
			</map>
	        </property>
 			-->
	</bean>
	
	<bean id="adContextSourcePool" class="org.springframework.ldap.pool.factory.PoolingContextSource">
		<property name="contextSource" ref="adContextSource" />
		<property name="dirContextValidator" ref="dirContextValidator"/>
		<property name="testWhileIdle" value="true"/>
		<property name="testOnBorrow" value="true"/>
	</bean>
	 
	<bean id="adContextSource"
		class="org.springframework.ldap.core.support.LdapContextSource">
		<property name="url" value="ldaps://ad.univ-ville.fr:636" />
		<property name="base" value="DC=ur,DC=univ-ville,DC=fr"/>
		<property name="pooled" value="true" />
		<property name="userDn"	value="cn=Administrateur,cn=users,dc=ur,dc=univ-ville,dc=fr"/>
		<property name="password" value="XXXXXXXX" />
	</bean>
	
	<bean id="adLdapTemplate" class="org.springframework.ldap.core.LdapTemplate">  
		<constructor-arg ref="adContextSourcePool" />
		<property name="ignorePartialResultException" value="true"/>
	</bean>
	<bean id="adValidateService" class="org.esupportail.sgc.services.ldap.LdapValidateService">
		<property name="ldapTemplate" ref="adLdapTemplate"/>
		<property name="peopleSearchFilter" value="(&amp;(objectClass=person)(cn={1}))"/>
		<property name="ldapCardIdsMappingValue">
			<map>
				<entry key="pager">
					<value>%csn%</value>
				</entry>
			</map>
		</property>
	</bean>
	<bean id="ipService" class="org.esupportail.sgc.services.IpService">
	    <property name="maps">
			<bean class="org.springframework.beans.factory.config.PropertiesFactoryBean">
				<property name="location" value="classpath:ip.properties"/>
			</bean>
		</property>
	</bean>
	<bean class="org.springframework.mail.javamail.JavaMailSenderImpl" id="mailSender">
		<property name="host" value="${email.host}"/>
		<property name="protocol" value="${email.protocol}"/>
	</bean>
    
	<bean id="emailService" class="org.esupportail.sgc.services.EmailService">
		<property name="mailSender" ref="mailSender"/>
		<property name="isEnabled" value="true"/>
	</bean>

src/main/resources/META-INF/spring/sgc.properties

Si cette règle (valeur/propriété recto7Replace) est déportée dans un fichier de properties c'est pour pouvoir utiliser les caractères (réservés en XML) < et > 

recto7Replace=#userInfosInComputing['recto7'] != Null ? #userInfosInComputing['recto7'].replaceAll('/','<br/>') : ''

src/main/resources/META-INF/spring/applicationContext-crous.xml

	<bean id="httpClientFactory"
		class="org.springframework.http.client.HttpComponentsClientHttpRequestFactory">
		<property name="connectTimeout" value="10000" />
		<property name="readTimeout" value="10000" />
		<property name="httpClient" ref="httpClient"/>
	</bean>
	<bean id="restTemplate" class="org.springframework.web.client.RestTemplate">
		<constructor-arg ref="httpClientFactory" />
	</bean>
	
	<bean id="httpClientBuilder" class="org.apache.http.impl.client.HttpClientBuilder"
	    factory-method="create">
	    <property name="connectionReuseStrategy">
	    	<bean class="org.apache.http.impl.NoConnectionReuseStrategy"/>
	    </property>
	</bean>
	
	<bean id="httpClient" factory-bean="httpClientBuilder" factory-method="build" />
	<bean id="apiCrousService" class="org.esupportail.sgc.services.crous.ApiCrousService">
		<property name="enable" value="true"/>
		<property name="webUrl" value="https://api.lescrous.fr/v1" />
		<property name="login" value="XXXXXXXX" />
		<property name="password" value="XXXXXXXXXXXXXXXXXXXXXX" />
		<property name="restTemplate" ref="restTemplate" />
	</bean>
	
	
	<bean id="esistCrousService" class="org.esupportail.sgc.services.crous.EsistCrousService">
		<property name="esistFiles">
			<list>
				<!-- value>esist/ESIST-cnrs.xml</value-->
				<value>esist/ESIST-02012018-no-hbg.xml</value>
			</list>
		</property>
	</bean>

	<bean id="europeanStudentCardService" class="org.esupportail.sgc.services.esc.ApiEscrService">
		<property name="enable" value="false"/>
		<property name="webUrl" value="http://api-sandbox.europeanstudentcard.eu/v1" />
		<property name="key" value="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" />
		<property name="restTemplate" ref="restTemplate" />
		<property name="countryCode" value="FR"/>
		<property name="picInstitutionCode" value="XXXXXXXXXX"/>
		<!-- 
		Type of cards. Possibles values are :
		1 - passive card, with no electronic
		2 - Smartcard without European common data zone
		3 - Smartcard with European common data zone
		4 - Smartcard on which application may be installed by service providers
		 -->
 		<property name="cardType" value="2"/>
	</bean>

	<bean id="escUidFactoryService" class="org.esupportail.sgc.services.esc.EscUidFactoryService">
		<property name="pic" value="XXXXXXXXX"/>
		<property name="prefixe" value="1 " />
		<property name="qrCodeUrlPrefixe" value="http://pp.esc.gg/" />
	</bean>
</beans>

src/main/resources/META-INF/spring/applicationContext-acces-control.xml 

<bean id="accessControlService" class="org.esupportail.sgc.services.ac.AccessControlService">
	<property name="use4ExternalCard" value="true"/>
</bean>
<!-- majP2S  tous les jours à 8H30
<task:scheduled-tasks>
<task:scheduled ref="csvExportP2sService" method="export2P2S" cron="0 30 08 * * *"/>
</task:scheduled-tasks>
--> 
<bean id="p2sVfsAccessService" class="org.esupportail.sgc.services.fs.CifsAccessService">                                                                                                                       
	<property name="uri" value="smb://p2s.univ-ville.fr/import-P2S/" />                                                                                                                                     
	<property name="domain" value="univ-ville" />
	<property name="username" value="import-P2S" />
	<property name="password" value="XXXXXXXX" />                                                                                                                                                                 	
</bean>                                                                                                                                                                                                                        
<bean id="synchronicVfsAccessService" class="org.esupportail.sgc.services.fs.CifsAccessService">
	<property name="uri" value="smb://synchronic.univ-ville.fr/import-synchronic/" />
	<property name="domain" value="univ-ville" />
	<property name="username" value="import-SYNCHRONIC" />
	<property name="password" value="XXXXXXXX" />
</bean>                                                                                                                                                                                                       
                                                                                                                                                                                                         
<bean id="tilVfsAccessService" class="org.esupportail.sgc.services.fs.CifsAccessService">
	<property name="uri" value="smb://til.univ-ville.fr/import-til/" />
	<property name="domain" value="univ-ville" />
	<property name="username" value="import-TIL" />
	<property name="password" value="XXXXXXXX" />
</bean>     

 


  • No labels