Create Moodle Login with Microsoft Authentication

Опубликовано: 20 Март 2026
на канале: CodeWrapper Studio
8,011
57

Step by step to complete the implementation:
Step 1: Login to https://portal.azure.com/

Step 2: Click on "Manage Azure Active Directory"

Step 3: From the left hand menu, select 'App registrations'

Step 4: Select 'New registration'

Step 5: Choose a good name as this is what is shown to users when they are asked to approve the permissions.

Step 6: Under supported account types select either:
For single user login use :'Accounts in this organizational directory only (your organization's name - Single tenant)'
For multiple users login use : 'Accounts in any organizational directory (Any Azure AD directory - Multitenant)'.

Step 7: Click 'Register'.

Step 8: Keep save "Application ID" : 6cb41260-c722-4d20-8a96-33815bff92f9

Step 9: Select 'Authentication' from side-bar menu.

Step 10: Ensure implicit grant flow is disabled.

Step 11: Select 'API permissions' from side-bar menu. - Make sure the "Microsoft Graph (1)" permissions section contains the "User.Read" permission.

Step 12: Select 'Certificates & secrets' from side-bar menu and Click 'New client secret' to create password/client secret.

Step 13: Copy the secret value to a safe place for later use.(not secret ID) : hBt8Q~i0hNz1mlEIbO7MSAW1pauwh4jxyTAMkcAB

Step 14: Login to Moodle and search for OAuth2 services - add application ID and secret value

Step 15: enable "OAuth 2" in Manage authentication


Step 15: create new Microsoft service

Step 16: Enter the password/secret as the "Client secret" and the Application ID as the "Client ID".