I just wanted to thank you for pointing me in the right direction! Took me WEEKS to figure out how to fix this. I changed the value returned in azuread.php scrip in the get_resource() function but that didn't fix it.
Here is the command I ran that ended up fixing it for me:
for i in $(grep -iRl graph.windows.net moodle/htdocs/* 2>/dev/null); do echo $i; sudo sed -i 's/graph.windows.net/graph.microsoft.com/g' $i; done
There was a hardcoded value of https://graph.windows.net in the following files:
htdocs/auth/oidc/settings.phpOnce I did that, I restarted the httpd, php-fpm, and mysql servers. Then I logged back in using my Microsoft creds and now it says i'm connected and lists all of the apps I enabled!
htdocs/auth/oidc/tests/privacy_provider_test.php
htdocs/auth/oidc/classes/oidcclient.php
htdocs/local/o365/tests/sdssync_test.php
htdocs/local/o365/tests/azuread_test.php
htdocs/local/o365/tests/sharepoint_test.php
htdocs/local/o365/tests/coursegroups_test.php
htdocs/local/o365/classes/healthcheck/systemapiuser.php
htdocs/local/o365/classes/feature/usergroups/coursegroups.php
htdocs/local/o365/classes/oauth2/token.php
htdocs/local/o365/classes/rest/sds.php
htdocs/local/o365/classes/rest/azuread.php
Again, without finding your post I wouldn't have figured that out so thank you.