microsoft / o365-moodle

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

User Provisioning (JIT and User Sync) not mapping user information #1102

Closed svajiraya closed 5 years ago

svajiraya commented 5 years ago

Hi,

I'm trying to set up field mapping using local_o365 and I have the following in my configuration right now:

image

However, the parameters are not being synced on login and users are prompted with Profile Edit page.

Moodle user search page: image

Moodle profile edit page (Admin User view): image

I can confirm that all recommended settings mentioned on Moodle Documentation page have been enabled, still no luck.

System Details: Microsoft Office 365 Integration - Version 2018051706 Moodle - Version 3.5.2 (Build: 20180910)

-S Vajiraya UNSW Sydney

jamesmcq commented 5 years ago

Hi @svajiraya - this can happen if the plugins have an issue communicating with Office 365. Can you confirm that the plugins have been set up correctly? Check the "Verify Setup" section on the setup tab and the "Health Check" tool from the Advanced tab.

If both of these look good, we'll need to collect some additional information to determine what might be preventing that information from coming through. Enable "Record debug messages" both from the advanced tab in the local plugin, and in the OpenID Connect authentication plugin. This will start recording additional information when the plugins encounter API errors. These messages are viewable from the Moodle logs (There's a direct link next to the "Record debug messages" setting in the local plugin).

After enabling these settings, check the logs when this problem happens again to see if there are any messages. Most messages will give you a pretty good idea of what's happening, but feel free to either post here or message me if you need some additional help figuring out what's going on. These messages can include user details and API tokens, so be sure not to share anything you want to keep private.

svajiraya commented 5 years ago

Hi James,

Setup looks good. Screenshots below:

image

and

screen shot 2019-02-28 at 3 13 50 am

However, I found the cause of the issue. For some reason, Token-refresh mechanism wasn't kicking in. I deleted all the stale tokens in Moodle mdl_auth_oidc_token table and mdl_local_o365_token.

The JIT seems to be picking up the required parameters.

image

Let's close this issue for now, I will re-open if the issue re-appears.

Regards, S Vajiraya Educational Intelligence & Analytics, UNSW Sydney