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!
Again, without finding your post I wouldn't have figured that out so thank you.