Set up and configure the Moodle LMS plugins for Open LMS
In this article, you'll learn how to install and configure the Moodle LMS plugins to integrate Microsoft Teams with your Open LMS experience.
Prerequisites
To set up and configure an installed Open LMS to work with Microsoft Teams:
- Verify the Moodle OpenID Connect and the Microsoft 365 integration plugins are active.
Configure the connection between the Microsoft 365 plugins and Microsoft services
You must configure the connection between the Microsoft 365 plugins and Microsoft services before they can work together.
Note
While configuring the integration, keep your Microsoft 365 integration configuration page open in a separate browser tab because you'll need to return to these pages throughout the process.
Enable the OpenID Connect authentication plugin
In order for the Moodle plugins to communicate with Microsoft services, the OpenID Connect authentication plugin needs to be turned on and configured.
- Navigate to Site Administration > Plugins > Authentication then select Manage Authentication.
- Find the OpenID Connect authentication plugin and select the eye icon to turn it on.
- Select Settings for the plugin to verify the Authorization and Token endpoints.
- The default values should be:
- Authorization endpoint:
https://login.microsoftonline.com/common/oauth2/authorize
. - Token endpoint:
https://login.microsoftonline.com/common/oauth2/token
.
- Authorization endpoint:
- The default values should be:
- Record the Redirect URI for later use.
Note
It isn't required for all Open LMS users to use the OpenID Connect authentication plugin as their authentication method; however, if they use other authentication methods, their Open LMS accounts needs to be connected to their corresponding Microsoft accounts before they can use certain features in the Teams integration, like syncing Teams ownership and membership.
Requisites
Register Open LMS as an application in your Microsoft Entra ID using the PowerShell script. The script provisions the following items:
- A new Microsoft Entra application for your Microsoft 365 tenant, which is used by the Microsoft 365 Moodle plugins.
- The app for your Microsoft 365 tenant sets up the required reply URLs and permissions for the provisioned app and returns the
AppID
andKey
. - On operating systems that aren't Windows, you should only follow the manual process to register your Open LMS instance in Azure. Check the Important alert section below for details.
Important
For more information on registering your Open LMS instance manually, see Register your Open LMS instance as an application.
Once you register your app, verify that all the Azure app permissions are applied. For more information, see Azure app permissions.
Register application in Azure using PowerShell
Step 1: Create Azure app
Navigate to Site Administration > Plugins > Local plugins then select Microsoft 365 Integration. This will open the Microsoft 365 Integration configuration page.
From the Microsoft 365 Integration configuration page, select the Setup tab.
Select the Download PowerShell Script button and save it as a ZIP folder to your local computer.
Note
Running the script creates a new Microsoft Entra application in Microsoft 365 tenant, which sets up the required reply URLs and permissions, gives the required permissions, and returns the
AppID
andKey
.The script doesn't work in PowerShell on operating systems that aren't Windows.
Prepare the PowerShell script from the ZIP file as follows:
- Download and extract the
Moodle-AzureAD-Powershell.zip
file. - Open the extracted folder.
- Right-click on the
Moodle-AzureAD-Script.ps1
file and select Properties. - Under the General tab of the Properties window, select the
Unblock
checkbox next to the Security attribute located at the bottom of the window. - Select OK.
- Copy the directory path to the extracted folder.
- Download and extract the
Run PowerShell as an administrator:
- In Windows, open the start menu.
- Type
PowerShell
. - Right-click on Windows PowerShell.
- Select Run as Administrator.
Navigate to the unzipped directory by typing
cd .../.../Moodle-AzureAD-Powershell
where.../...
is the path to the directory.Execute the PowerShell script:
- Enter
./Moodle-AzureAD-Script.ps1
. - When asked, sign in to your Microsoft 365 administrator account in the pop-up window.
- When asked, enter the name of the Microsoft Entra Application. For example, Open LMS, Moodle, or Moodle plugins.
- When asked, enter the URL for your Open LMS server.
- When asked, enter the reply URL copied from the OpenID Connect authentication plugin configuration page. This is the URL of your Open LMS site followed by
\auth\oidc\
. - You may be asked to sign in to your Microsoft 365 account again in a pop-up window in the process. This is to provide admin consent to the permissions added to the app for your organization.
- When the script finishes execution, copy the Application ID (
AppID
) and Application Key(Key
) generated by the script and save them.
- Enter
Step 2: Set Azure app details in OpenID Connect
- Return to the OpenID Connect authentication plugin configuration page.
- Paste the
AppID
value into the Application ID box and theKey
value into the Key box, and then select Save changes.
Step 3: Configure connection between Microsoft plugins and Microsoft services
- From the Microsoft 365 Integration configuration page, select the Setup tab.
- In Choose connection method, select Application access, and then select Save changes again.
- After the page refreshes, you can see another new section Admin consent & additional information.
- Select Provide Admin Consent link, enter your Microsoft 365 Global Administrator credentials, then Accept to grant the permissions.
- Next to the Microsoft Entra tenant field, select the Detect button.
- Next to the OneDrive for Business URL, select the Detect button.
- After the fields populate, select the Save changes button again.
- Select the Update button to verify the installation. If no error is reported at this stage, it means the Microsoft plugins can communicate with Microsoft server via Microsoft Graph APIs.
Step 4: Configure user and course synchronization
Synchronize users between your Open LMS server and Microsoft Entra ID. Depending on your environment, you can select different options during this stage. To get started:
From the Microsoft 365 Integration configuration page, select the Sync Settings tab.
In the Sync users with Microsoft Entra ID setting, select the checkboxes that apply to your environment. You must select the following options:
✔ Create accounts in Open LMS for users in Microsoft Entra ID. ✔ Update all accounts in Open LMS for users in Microsoft Entra ID.In the User Creation Restriction section, you can set up a filter to limit the Microsoft Entra users that are synced to Open LMS.
Note
It isn't absolutely required to enable user sync; however, it'll make connecting Open LMS users with Microsoft 365 accounts much easier.
User sync is performed by running the Sync users with Microsoft Entra ID scheduled task.
In the Course Sync section, you can select Course sync customization option to enable the automatic creation of Teams for some or all of your existing Open LMS courses.
Note
Course sync is performed by running the Sync Moodle courses to Microsoft Teams scheduled task.
Save changes.
To validate sync configuration, you'll need to run the scheduled tasks manually for the first time. Navigate to Site administration > Server > Tasks > Scheduled tasks.
- Scroll down and find the task Sync users with Microsoft Entra ID and select Run now.
- This will sync Microsoft Entra users to your Open LMS site according to the user sync options.
- Next, find the Sync Moodle courses to Microsoft Teams task and select Run now.
- This task will create groups for all Open LMS courses with sync option turn on, and also Teams if a Team owner can be found in the course.
- This task will also sync Open LMS users enrolled in the course to Teams as owners or members.
- A Team owner is an Open LMS user who meets all of the following criteria:
- is connected to a Microsoft 365 account.
- is enrolled in the course.
- has the
local/o365:teamowner
capability in the course context.
- Similarly, a Team member is an Open LMS user who meets all of the following criteria:
- is connected to a Microsoft 365 account.
- is enrolled in the course.
- has the
local/o365:teamember
capability in the course context.
- The default Teacher role has the
local/o365:teamowner
capability, and the default Student role has thelocal/o365:teammember
capability.
- A Team owner is an Open LMS user who meets all of the following criteria:
- Scroll down and find the task Sync users with Microsoft Entra ID and select Run now.
Note
The scheduled tasks are triggered by Moodle Cron, which needs to be configured to run frequently. Each scheduled task can have a default schedule and can be customized.
- The default schedule of the Sync users with Microsoft Entra ID task is every minute.
- The default schedule of the Sync Moodle courses to Microsoft Teams task is daily at 1 am in the Open LMS server default time zone.
After the plugins are installed and configured, you can:
- Add Teams classes and meetings to Open LMS.
- Deploy Moodle Assistant Bot to Azure.
- Add Moodle tabs to Teams classes.
Extra Moodle plugin documentation
If you would like to review Open LMS's Microsoft 365 integration guides and release notes, see these resources: