Table des matières

Auth NetYpareo: requests and data flows

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.

Overview

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.

Protocol and transport security

1. Single sign-on (token SSO)

  1. The user is logged in to NetYpareo and opens Moodle from a link that adds a token parameter to the Moodle login URL.
  2. The plugin reads this parameter when the login page is displayed. Without a token, it does nothing and the other login methods apply.
  3. If several NetYpareo instances are configured (PRO version), the originating instance is identified by the Referer HTTP header. A Moodle site without HTTPS may not receive this header.
  4. Moodle calls NetYpareo to validate the token:
GET {baseurl}/r/v1/authentification-jeton/utilisateur/{jeton}
Header: X-Auth-Token: <service token>
  1. If the REST call fails, a second attempt is made using SOAP (token authentication service).
  2. The response gives the user type (learner, staff, tutor/company) and the identity: last name, first name, email address and NetYpareo internal code.
  3. Moodle looks up the existing account by its identification number (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.
  4. The password is neither transmitted nor stored by this flow.

2. 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.

Data imported into Moodle

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.

3. Sending documents to NetYpareo

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

What the plugin does not send

Storage in Moodle

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.

Points of attention


Back to the component index - Back to the plugin index - Back to the catalog