This page describes the exchanges between Moodle and NetYpareo (Yparéo) carried out by the authentication plugin auth_netypareo: who calls whom, with which method, which requests are issued and which data flows in each direction. It is intended for the security and compliance officers of the organisations using the plugin.
Exchanges take place in three distinct contexts:
| Context | Trigger | Direction | Data |
|---|---|---|---|
| Single sign-on (SSO) | The user clicks from NetYpareo | NetYpareo → browser → Moodle, then Moodle → NetYpareo | A validation token, then the user's identity |
| Scheduled synchronisation | Moodle scheduled tasks, at night | Moodle → NetYpareo (read requests) | Users, sites, groups, periods, training courses |
| Document feedback | A document is generated in Moodle | Moodle → NetYpareo (upload) | A learner's PDF document |
In all cases Moodle is the client: the plugin opens no entry point allowing NetYpareo to read from or write to Moodle. The only element received from NetYpareo is the login token, passed on by the user's browser.
X-Auth-Token HTTP header of each request (authwsresttoken setting). With SOAP, service credentials (login and password) are used, distinct for each service (authentication, users, Pareo, EDM).CURLOPT_SSL_VERIFYPEER set to false). See the Points of attention section.token parameter to the Moodle login URL.GET {baseurl}/r/v1/authentification-jeton/utilisateur/{jeton}
Header: X-Auth-Token: <service token>
idnumber, in the form {instance}_{NetYpareo code}). If the account exists and is not suspended, the session is opened and the user is redirected to the home page. No account is created at this step: accounts are created by the scheduled synchronisation.Scheduled tasks query NetYpareo in read-only mode. Default schedules (editable in the Moodle administration):
| Task | Schedule | REST requests issued |
|---|---|---|
| Sites | 00:30 | GET /r/v1/sites |
| Reference data caches | 00:05 | statuses, situations, training courses, diplomas, subjects, business sectors, countries, periods, companies (GET /r/v1/statuts, /situations, /formations, /diplomes-prepares, /matieres, /secteurs-activite, /pays, /periodes, /entreprises) |
| Trainers (staff) | 01:00 | GET /r/v1/utilisateur/personnels/{site} |
| Tutors and companies | 01:10 | GET /r/v1/entreprises |
| Learners | 01:20 | GET /r/v1/utilisateur/apprenants/{site} |
| Groups | 02:30 | GET /r/v1/formation-longue/groupes (parameters: periods, sites) |
| Short training groups | 04:30 | GET /r/v1/formation-courte/{…}/groupes |
Detail requests are also available for a learner, a group or a staff member (/r/v1/apprenants/{code}, /r/v1/groupes/{code}, /r/v1.1/personnels/{code}, /r/v1/formation-longue/apprenants, /r/v1/groupes/{code}/apprenants, /r/v1/formation-courte/…/apprenants, /r/v1/apprenants/frequentes, /r/v1/document/apprenants/{code}/photo). To be checked: which of these functions are actually called by the tasks of the delivered version.
Each task can be disabled by a setting (syncstudents, syncteachers, synctutors, syncsites, syncgroups, syncpdgroups). Filters (PRO version) allow restricting the import to the desired sites, periods or groups.
Default mapping for a learner (NetYpareo fields → Moodle fields):
| NetYpareo data | Moodle field |
|---|---|
prenom / nom | First name / Last name |
email (or adresse.email) | Email address |
login | Username (prefixed with the instance number) |
codeApprenant | Identification number (idnumber, prefixed with the instance number) |
codeSite | Home site (profile field) |
compteExpireLe | Account expiry date |
adresse.ville, nomPays | City, country |
nomEtabOrigine, departement | Institution, department |
tel1, tel2 | Phone numbers |
estMajeur | “Adult” profile field |
codeStatut, codeDiplome, codeFormation, codeAnnee | Profile fields: status, curriculum, programme, programme year |
For a trainer: first name, last name, username, email, staff code, home site (name and code). For a tutor or company: first name, last name, username, email, contact code, company name.
For groups: name, site, training year, lead trainer, action category, assessment mode, teaching and entry/exit arrangements.
Accounts have the authentication method netypareo. Former accounts that no longer appear in NetYpareo can be suspended or deleted depending on the deleteoldusers, deleteoldsites and deleteoldcachedata settings.
To be checked: the exact field mapping can be adapted per instance (PRO version); the tables above are those of the default configuration.
When the sendpdcertificates setting is active and a certificate is generated in Moodle (pdcertificate module), the plugin sends the PDF document to the EDM folder of the learner concerned:
POST {baseurl}/r/v1/document/apprenant/{codeApprenant}/document[/{folder}]
Header: X-Auth-Token: <service token>
Corps JSON : contenu (base64), nomDocument, extension, mimeType, dateCreation
Imported data is stored in Moodle's standard tables (user, user_info_data for profile fields, cohorts and groups) and in the plugin's own tables (instances, reference data caches: sites, statuses, situations, training courses, diplomas). Synchronisation logs are written to the configured log directory (logdir); their content may include user names and identifiers.
Back to the component index - Back to the plugin index - Back to the catalog