...
Voici un exemple complet :
Bloc de code | ||||
---|---|---|---|---|
| ||||
<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="desfireComueTagEsupSgc" class="org.esupportail.nfctag.beans.DesfireTag" p:formatBeforeWrite="false" p:keyStart="0000000000000000" p:keyTypeStart="DES" p:keyFinish="0000000000000000" p:keyTypeFinish="DES" p:keyVersionFinish="00"> <property name="applications"> <util:list> <bean class="org.esupportail.nfctag.beans.DesfireApplication" p:desfireAppId="AB0123" 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="idp2sTagWriteEsupSgc"/> </util:list> </property> <property name="keys"> <util:list> <bean class="org.esupportail.nfctag.beans.DesfireKey" p:keyNo="00" p:keyVer="01" p:key="00000000000000000000000000000000"/> <bean class="org.esupportail.nfctag.beans.DesfireKey" p:keyNo="01" p:keyVer="01" p:key="00000000000000000000000000000000"/> <bean class="org.esupportail.nfctag.beans.DesfireKey" p:keyNo="02" p:keyVer="01" p:key="00000000000000000000000000000000"/> <bean class="org.esupportail.nfctag.beans.DesfireKey" p:keyNo="03" p:keyVer="01" p:key="00000000000000000000000000000000"/> </util:list> </property> </bean> </util:list> </property> </bean> |
...
Voici la structure d’une application DesfireApplication:
Bloc de code | ||||
---|---|---|---|---|
| ||||
<bean class="org.esupportail.nfctag.beans.DesfireApplication" p:desfireAppId="AB0123" 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="idp2sTagWriteEsupSgc"/> </util:list> </property> <property name="keys"> <util:list> <bean class="org.esupportail.nfctag.beans.DesfireKey" p:keyNo="00" p:keyVer="01" p:key="00000000000000000000000000000000"/> <bean class="org.esupportail.nfctag.beans.DesfireKey" p:keyNo="01" p:keyVer="01" p:key="00000000000000000000000000000000"/> <bean class="org.esupportail.nfctag.beans.DesfireKey" p:keyNo="02" p:keyVer="01" p:key="00000000000000000000000000000000"/> <bean class="org.esupportail.nfctag.beans.DesfireKey" p:keyNo="03" p:keyVer="01" p:key="00000000000000000000000000000000"/> </util:list> </property> </bean> |
...
Il faut configurer l’url qui permet de récupérer cette valeur (ici c'est esup-sgc qui fournit la donnée) :
Bloc de code | ||||
---|---|---|---|---|
| ||||
<bean id="idp2sTagWriteEsupSgc" class="org.esupportail.nfctag.service.api.impl.TagWriteRestWs"> <property name="idFromEppnInitUrl" value="https://esup-sgc-test.univ-rouen.fr/wsrest/nfc/idFromEppnInit"/> </bean> |
...
Ajout d'une configuration NFC pour une authentification en DESFIRE (NfcAuthConfig)
Bloc de code | ||||
---|---|---|---|---|
| ||||
<bean id="desfireAuthSiServices" class="org.esupportail.nfctag.service.api.impl.DesfireReadConfig"> <property name="desfireKeyNumber" value="01"/> <property name="desfireFileNumber" value="00"/> <property name="desfireAppId" value="AB0123"/> <property name="desfireAppName" value="si-service"/> <property name="desfireFileOffset" value="000000"/> <property name="desfireKey" value="00000000000000000000000000000000"/> <property name="description" value="Authentification SI Service COMUE"/> </bean> |
...
Ajout d'une application d' affichage du verso de la carte (AppliExtApi)
Bloc de code | ||||
---|---|---|---|---|
| ||||
<bean id="esupSgcVersoExtApi" class="org.esupportail.nfctag.service.api.impl.AppliExtRestWs"> <property name="isTagableUrl" value="https://esup-sgc-test.univ-ville.fr/wsrest/nfc/isTagable"/> <property name="validateTagUrl" value="https://esup-sgc-test.univ-ville.fr/wsrest/nfc/validateTag"/> <property name="getLocationsUrl" value="https://esup-sgc-test.univ-ville.fr/wsrest/nfc/locationsVerso"/> <property name="displayUrl" value="https://esup-sgc-test.univ-ville.fr/wsrest/nfc/verso"/> <property name="description" value="Web Service Verso"/> </bean> |
La nouvelle propriété displayUrl permet de définir l'emplacement des données qui seront affichées suite à la validation d'un tag. Esup-sgc peut retourner le verso en fonction du csn via cette adresse https://esup-sgc-test.univ-ville.fr/wsrest/nfc/verso.