microsoft / o365-moodle

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

Error in API Call - Microsoft 365 Integration - Verify setup #2089

Open mahmutteker opened 2 years ago

mahmutteker commented 2 years ago

Hi,

I am trying to install Moodle (3.11) Microsoft 365 Integration plugins and installed auth_oidc (2021051725) and local_o365 (2021051725) with no problem.

I was following the steps on https://docs.microsoft.com/en-us/microsoft-365/lti/moodle-plugin-configuration?view=o365-worldwide page.

I have run Moodle-AzureAD-Script.ps1 and created an app successfully (take the key, entered Moodle config page etc.), had no error on the configuration till the "Verify setup" part. It says "Setup is complete. Click the "Update" button below to verify your setup." but when I hit that button Microsoft Graph API gives " Error in API call." response.

When I check the debug messages there are :

Microsoft 365 Integration | API failure | local_o365\page\ajax::mode_checksetup (unified): Error in API call. Data: Array ( [file] => /local/o365/classes/rest/o365api.php [line] => 271 [message] => Error in API call. [debuginfo] => [errorcode] => erroro365apibadcall [module] => local_o365 )

Microsoft 365 Integration | API failure | local_o365\rest\o365api::process_apicall_response:1584: Bad response received Data: (string)Bad Request HTTP Error 400. The request is badly formed.

Ajax response: {"success":true,"data":{"legacyapi":{},"appdata":{},"unifiedapi":{"active":false,"error":"Error in API call."}}}

I couldn't be sure whether it is a configuration error or programming. Any idea?

Thanks,

_Mahmut

weilai-irl commented 2 years ago

Hi @tellotello,

Could you confirm if you have clicked the "Provide admin consent" button on the Microsoft 365 integration configuration page please. If you have, what happened when you clicked the "Detect" button for the "Azure AD Tenant" and "OneDrive for Business URL" settings?

Regards, Lai