microsoft / o365-moodle

Office 365 and Azure Active Directory plugins for Moodle
GNU General Public License v3.0
178 stars 134 forks source link

Field mappings and synchronization working only for few fields #2551

Open nvallinoto opened 2 months ago

nvallinoto commented 2 months ago

Dear Moodle developers,

I have successfully installed auth_oidc and local_o365 plugins for authorization and synchronization of users from Azure AD to Moodle using these Moodle/plugins versions:

_Moodle - version: 4.1 - 2022112800 OpenID Connect - auth_oidc - version: 4.1.4 - 2022112825 Microsoft 365 Integration - localo365 - version: 4.1.5 - 2022112826

The authorization is working quite well excluding the "Resource Owner Password Credentials Grant" login flow. This login flow inhibits some users to login to Moodle. At the moment I solved this issue using the "Authorization Code Flow" login flow.

The main problem I've encountered is the following:

Only these fields are mapped in Moodle: Given name, Surname, mail, UserPrincipalName.

Other fields are not mapped in Moodle such as:
SamAccountName, StreetAddress, OfficePhone, MobilePhone, extensionAttribute1..8, City, Company, Country, Department, DisplayName.

And other fields are not included in the combo, where you can choose the user data to be mapped from Open ID Connect Idp to Moodle, such as: Name, cn, sn.

The last unexpected behaviour is that all the users have been moved (synced) to Moodle (active and not active) but the disabled users in Azure AD (Enabled=false) are not suspended users in Moodle. They appear active in Moodle.

Maybe I missed or I made some mistakes in configuration's page of the Microsoft 365 plugins.

Maybe some of you already encountered these behaviours and can give me a suggestion to solve it.

Your help will be very appreciated.

nvallinoto commented 2 months ago

I have an update concerning the users sync from AD Azure to Moodle. Adding the tick to "Perform a full sync each run" (in Sync Settings of Microsoft 365 Integration) the behavior modified and after the execution of "Sync users from Microsoft Entra ID" daily task some further fields are now mapped and updated to Moodle. The fields I tried and worked are: SamAccountName, CIty, Department.

weilai-irl commented 1 month ago

Hi @nvallinoto

First of all, the "Resource Owner Password Credentials Grant" flow is deprecated. There has been no development or test done it for some time now. It will be removed from the plugin soon.

Regarding the user sync task:

Hope this helps.

Regards, Lai