Microsoft 365 Integration

General plugins (Local) ::: local_o365
Maintained by Enovation Dev Team, James McQuillan, Zion Brewer, Nima Mojgani
This plugin provides libraries and services that power other Microsoft 365 plugins.
Latest release:
5314 sites
119 fans
Current versions available: 12

Microsoft 365 Plugins for Moodle

Microsoft 365 Integration Local Plugin

This plugin provides libraries and services and power other Microsoft 365 plugins.

This is part of the suite of Microsoft 365 plugins for Moodle.

To follow active development on GitHub, click here.

This plugin is updated with stable Moodle releases. This means:

  • New features, bug fixes for general core bugs, and security issues for all plugin versions for Moodle 3.9.x and earlier versions have ended, with the following exception:
    • Bug fixes for security issues for Moodle 3.9.x versions will end 8 May 2023.
  • For plugin versions for Moodle 3.10:
    • New features and full support until November 2021.
    • Bug fixes for security issues until May 2022.
  • For plugin versions for Moodle 3.11 (to be released in July 2021):
    • New features and full support until May 2022.
    • Bug fixes for security issues until November 2022.


Before we can accept your pull request, you'll need to electronically complete Microsoft's Contributor License Agreement. If you've done this for other Microsoft projects, then you're already covered.

Why a CLA? (from the FSF)


(c) Microsoft, Inc.

Code for this plugin is licensed under the GPLv3 license.

Any Microsoft trademarks and logos included in these plugins are property of Microsoft and should not be reused, redistributed, modified, repurposed, or otherwise altered or used outside of this plugin.


This plugin is part of set Microsoft 365.


Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4
Screenshot #5


Enovation Dev Team (Lead maintainer)
Vinayak (Vin) Bhalerao
Akinsaya Delamarre
Please login to view contributors details and/or to contact them

Comments RSS


  • Wed, Sep 16, 2015, 1:12 AM
    Hi Martin,

    That is very odd! What exactly happens when you have this special character in the password? Does Moodle give you an error message or Azure/O365?
  • Wed, Sep 16, 2015, 7:49 PM
    Hi James,

    The Moodle log states: "Login failed for the username xyz for the reason with id '3'".
    I found that just means that someone tried to log in with a valid username but with a wrong password.
    By the way we implemented Moodle 2.9.1+ (Build 20150730)
  • Thu, Sep 17, 2015, 3:18 PM
    Thanks Martin - I've created an issue to investigate this further. Stay tuned for updates.
  • Tue, Sep 22, 2015, 11:05 PM
    I have upgraded my site to the latest 2.9.2+ and the system doesn't take any of my new users from our Office 365 subscription anymore. When I run cron manually I can see all of the missing usernames with the following error message:

    "Execute scheduled task: Sync users with AAD.
    ... started 16:17:47. Current memory use 32.7MB.
    Could not create user "" Reason: Hiba az adatbázis írása közben."

    ... and the list continues with the other users and the same error message...

    "Hiba az adatbázis írása közben" means: "an error happened when writing into the database".

    The strangest thing is that they CAN still log into the system, but only as brand new users and they have to supply all of their data (eg.: e-mail address) after the login page.

    Any ideas? smile
  • Wed, Sep 23, 2015, 1:29 AM
    Hi Marton - Just to confirm, you've updated the Moodle core code but are on the same version of the plugins? And this started happening after the Moodle core upgrade?
  • Wed, Sep 23, 2015, 1:47 AM
    Dear James,

    Thank you for your reply!

    I can't be absolutely sure if the error happened after the update, but I would say it about 90%.

    We are still using our office 365 subscription as an experimental project in our school, so I only registered the teachers in September. That time Moodle got all of the users from O365 successfully (although I had problems with users that were deleted from O365 later on). This weekend I upgraded all of our plugins to the latest releases and than Moodle itself from 2.9.1+ to 2.9.2+ successfully. A few hours later I added all of my students as well (~ 100) to O365 with student licenses and I thought everything will be alright. Yesterday I found out that my new users were not synced so I ran cron manually and that is what I got.

    Unfortunately I am only a power user and not a programmer and I still have very little experiment with O365.
  • Thu, Oct 1, 2015, 1:32 AM
    Dear James,

    It seems that the program only sync users with teachers licenses. I had deleted all of my users from O365, then I ran cron. I got all of my teachers back, but my students not. Could you, or anyone help me?
  • Thu, Oct 1, 2015, 2:13 AM
    OKO, I have figured it out. Users with "Magyarország" (Hungary) in the "Country / region" field are not synced. When I empty the field the user is synced successfully.
  • Fri, Oct 2, 2015, 12:16 AM
    Thanks Marton - I've created an issue to investigate user sync with that value.
  • Tue, Dec 15, 2015, 4:59 AM
    Trying to remove my Office 365 account on a user and getting the below errors - tried on multiple different user accounts.

    Debug info:
    Error code: errorucpinvalidaction
    Stack trace: •line 54 of \auth\oidc\ucp.php: moodle_exception thrown

  • Wed, Jan 6, 2016, 6:09 PM
    We have different experience in installing the Office 365 - Moodle plug-in, when the Moodle instance is running on Windows server versus when it is running on Linux. On Windows Server is worked smoothly and on Linux we have run into problems. here is the description: -
    << behavior observed>> when clicking the "Moodle" icon from Office 365 after the plug-in install, the login to Moodle wasn't successful, and the web-browser page kept oscillating back and forth.
    << Error meg. >> The reply address ‘http://poc-elearning. /auth/oidc/’ does not match the reply address ‘http://poc-elearning. /auth/oidc’ provided when requesting authorization code. There is a difference of “/” character in the two URLs.
    << Action Taken >> used fiddler to temper and inject the “/” in the url being send to Moodle by Office 365. Also in the App registration changed the URI to include the “/”.
    <> same no change in behavior observed.
    <> can anyone guide us to resolve this issue ?
  • Wed, Jan 6, 2016, 7:43 PM
    Hi lalit mohan, Make sure the trailing slash is present on the URL in Azure- it must be exactly as appears in the OpenID Connect settings page.
  • Thu, Jan 14, 2016, 5:41 AM
    I couldn't connect to office365 I updated all o365 plugins on moodle 2.9.1 and now I get
    Fatal error: Can't use function return value in write context in /var/www/ on line 62, if I like to open a module with texteditor.

    If I set the permission on msaccount directory to 0000 the texteditor works well. I migth be, that at the first installation month ago something didn't go well.

    What can I do?
    - deinstalling: not all plugins have an uninstall link.
    - updating to moodle 3.0.1

    Is this a solution?
    I was getting this error while trying to do this in php:
    if empty($userSession = $this->Session->read('User')) { //do something; }

    The solution to get over this is to define a variable before actually testing for its value, as such.
    $userSession = $this->Session->read('User');
    if empty($userSession) { // do something; }

    As a rule of thumb, the php function empty cannot check the return value of a function or method. It can only check variables.

    Thanks for your help.

  • Fri, Jan 22, 2016, 5:14 PM
    Thanks a lot for this very helpful plugin!
    Is there a way to access shared files through the onedrive for business plugin?
    Best regards from Austria!
  • Sat, Jan 23, 2016, 3:26 AM
    @herbert - Not yet, although that is on our radar.
Please login to post comments