- Access Azure Active Directory:
- Go to the Azure portal.
- Sign in with your Microsoft 365 administrator account.
- Navigate to
Azure Active Directory
>App registrations [1]
.
-
Register a New Application:
-
Click on
New registration
. -
Enter a name for your application 2.
-
Choose
Accounts in this organizational directory only
orAccounts in any organizational directory
[3] depending on your user base. -
Under
Redirect URI
, [4] selectWeb
and enter the following URI:https://yourmoodleurl.com/admin/oauth2callback.php
Replace
yourmoodleurl.com
with your actual Moodle site URL. -
Click
Register
[5].
-
-
Configure API Permissions:
- After the app is created, go to
API permissions
[6]. - Click on
Add a permission
[7], selectMicrosoft Graph
,[8] and then chooseDelegated permissions
[9]. - Add the following permissions [10]:
openid
profile
email
offline_access
- Click
Add permissions
[11]. - Grant admin consent for your organization.
- After the app is created, go to
- Create Client Secret:
- Go to
Certificates & secrets
[12]. - Click on
New client secret
[13], provide a description, and set an expiration period. - After creating the client secret, copy the value immediately;[14] you will need this for Moodle.
- Go to
-
Login to Moodle as Admin:
- Log in to your Moodle site as an administrator.
-
Enable OAuth 2 Services:
-
Add Microsoft as an OAuth 2 Service:
-
Once the above steps have been completed, Moodle O365 Authentication click "Overview" if not already selected and choose "Endpoints"
-
From the list of endpoints copy the OpenID Connect metadata document endpoint URL. It is only necessary to copy the portion up to and including "v2.0". In the example below, the copied URL would be, "https://login.microsoftonline.com/96e0421d-d572-4839-9c32-b8bc00cf250b/v2.0/". Note that it is important to include the trailing slash.
- Now return to Moodle and in the newly created OAuth2 Microsoft service, paste the endpoint in the 'Service base URL' field.
- Save your changes.
- Enable Microsoft 365 Login:
-
Log Out:
- Log out of Moodle.
-
Test the Login:
https://docs.moodle.org/403/en/OAuth_2_Microsoft_service
Here is the corrected step-by-step guide:
- Login with Google
Go to the Google Cloud Console:
https://console.cloud.google.com
- Create a New Project or Select an Existing Project [1] if you select "New Project [2], add project name and [3] Click Create button [4]"
- Navigate to the API & Services [7] > Credentials section [8]
- Go to API & Services and click on Credentials [9].
-
Create OAuth 2.0 Client ID [10]
-
Configure Consent Screen [12]
-
Select User Type External [13] and click the Create [14] button.
-
Under Edit app registration > OAuth Consent Screen > App Information, fill in the required details.
- In the Authorized domain [16]s section, add the domain of your Moodle site and provide the developer contact information.
- Click Save and Continue [17].
-
Scopes Section
- Click Save and Continue in the Scopes section.
- Then, click on the Back to Dashboard button.
-
Create OAuth Client ID
-
Go to Credentials[18] again, then click on Create Credentials[19] and choose OAuth Client ID[20].
-
Select Web Application as the application type [18].
- Configure Authorized Redirect URLs[21]
- Add the following authorized redirect URL:
https://your-moodle-site.com/admin/oauth2callback.php
- Click Create [22]
12 **Configure Moodle for Google Cloud Console Authentication**
i. Login to Moodle as Admin:
ii. Enable OAuth 2 Services:
iii . Add Google as an OAuth 2 Service:
- Name the service[27] (e.g., "Google").
- In the
Client ID
[28] field, paste theApplication (client) ID
from Google Cloud Console. - In the
Client secret
[29] field, paste the client secret you created in Google Cloud Console.
iv . Enable the Google API in Moodle