The AzureSync plugin synchronizes data from Microsoft SAML SSO into the GLPI database, based on Microsoft application attributes and claims. It depends on another plugin called PHP SAML by Derrick Smith.
On the GLPI server, extract the azuresync directory into the GLPI installation tree, inside the plugins directory.
From the GLPI interface, go to Configuration → Plugins, install the plugin and activate it.
Refresh the page: a new Azure Sync entry will appear under the Administration tab.
Since v1.1.0
The plugin configuration page allows you to store in the database the Azure application claim keys for:
- email address
- groups
- the department field (used by the synchronization rule Department to Entity).
Since v1.0.0
This synchronization rule adds the user to the corresponding GLPI group based on the Microsoft group.
Example:
The group “Support Tech” in Azure AD has the object ID 244cc64a-ae23-4ab1-8bd6-27c5ae3cbedf.
The same group exists in GLPI with ID 42.
The user fills in the form as follows:
- Association type: Group to Group
- Azure:
244cc64a-ae23-4ab1-8bd6-27c5ae3cbedf - Azure label (free field): Support Tech
- GLPI: select the Support Tech group
Since v1.0.0
This synchronization rule updates the GLPI user record using user data contained in the Microsoft authentication token.
Example:
To synchronize the user's mobile phone number, you must first add this claim to the Microsoft application.
In Azure:
- Open the application
- Go to Single sign-on
- In Attributes & Claims, click Edit
- Click Add a new claim
- Configure it as follows:
- Name:
mobilephone - Namespace: a distinct namespace used by GLPI to retrieve the value (can be empty or for example
https://www.restosducoeur.org/user) - Source attribute:
user.mobilephone
- Name:
- Save
This claim will then be present for every new SSO login to GLPI.
In the GLPI form:
- Association type: AD Attribute to User Attribute
- Azure identifier: full attribute path, e.g.
https://www.restosducoeur.org/user/mobilephone - Azure label: Mobile phone
- GLPI database column: the column name in the
glpi_userstable to update, e.g.mobile - GLPI label: Mobile phone
Since v1.1.0
This synchronization rule assigns a GLPI entity and profile to a user who belongs to a specific Azure AD group.
Example:
The group “Support Tech” in Azure AD has object ID 244cc64a-ae23-4ab1-8bd6-27c5ae3cbedf.
The corresponding GLPI entity is “Support Tech N1”.
Form configuration:
- Association type: Group to Entity
- Azure identifier:
244cc64a-ae23-4ab1-8bd6-27c5ae3cbedf - Azure label (free field): Support Tech
- GLPI entity: select Support Tech N1
- Profile: select the desired profile
- Recursive: enable or disable recursion
- Dynamic: enable or disable dynamic assignment
Since v1.1.0
This synchronization rule defines the user's default GLPI entity based on the Department attribute from Azure AD.
Example:
The Azure AD department value is “AN”, and the corresponding entity is “RDC > AN”.
Form configuration:
- Association type: Department to Entity
- Azure identifier: AN
- Azure label (free field): AN
- GLPI entity: select RDC > AN
- Profile: select the desired profile
- Recursive: enable or disable recursion
- Dynamic: enable or disable dynamic assignment
Synchronization rules can be imported or exported using a CSV file.
The column separator is ; and the fields must be in the following order:
- Row identifier (id)
- Azure identifier
- Azure label
- Association type:
0= Group to Group1= AD Attribute to User Attribute2= Group to Entity3= Department to Entity
- GLPI identifier
- GLPI label
- Recursive
- Profile
- Dynamic
Example:
7;d4ae92a3-3b66-403c-add0-1cc61a1418fe;"Users Member";2;3275;"Root entity > RDC Member";0;13;0
- The user clicks the Microsoft Login button and authenticates
- PHP SAML sends the authentication request to Microsoft
- PHP SAML retrieves and stores user data
- AzureSync is notified of the new session via a GLPI hook (
init_session) and retrieves data from PHP SAML - AzureSync updates the GLPI database
- In
inc/match.class.php, add a new enum value in thegetEnumAssociationTypefunction - In
templates/form.html.twig, add an HTML block:Replace X with the enum value added in step 1<div class="row association-type" id="association-group-X">...</div> - Inside this block, two inputs are mandatory:
glpi_id_Xglpi_label_X
where X is the enum value.
The form display is dynamic depending on the selected Association type
- In
inc/match.class.php, inside theupdateUserfunction, add the business logic corresponding to the new synchronization rule



