Skip to content

How to Configure Moodle Integration with Encvoy ID#

In this guide, you will learn how to set up Single Sign-On (SSO) in Moodle using the Encvoy ID system.

📌 Moodle is a learning management system for electronic educational courses (e-learning).

Setting up login via Encvoy ID consists of several key stages performed in two different systems:


Step 1. Create Application#

  1. Log in to the Encvoy ID system.
  2. Create an application with the following settings:

  3. Application Address - the address of your Moodle installation;

  4. Redirect URL #1 (Redirect_uri) - <Moodle installation address>/admin/oauth2callback.php.

    For more details on creating applications, read the instructions.

  5. Open the application settings and copy the values of the following fields:

    • Identifier (Client_id),
    • Secret Key (client_secret).

Step 2. Configure Moodle System#

Administrator rights in Moodle are required to configure user authentication.

Enable OAuth2 Plugin#

  1. Log in to Moodle with administrative rights.
  2. Go to Site administration - Plugins - Authentication and activate the OAuth 2 plugin by enabling it in the Enable column.

    Enabling OAuth 2 plugin in Moodle

Create a Custom Provider#

  1. Go to Site administrationServerOAuth 2 services.
  2. Click the Custom button.

    Button to create a custom provider in Moodle

  3. The provider creation form will open.

  4. Fill in the fields:

    • Name — any display name for the service;
    • Client ID — the Client_id of the Encvoy ID application;
    • Client Secret — the Client_secret of the Encvoy ID application;
    • Service Base URL<Encvoy ID Address>/api/oidc;
    • Show on login pageLogin page and internal services;
    • Scopes included in a login requestopenid profile email offline_access;
    • Scopes included in a login request for offline accessoffline_access.

    Moodle provider creation form - step 1

  5. Save changes.

Configure Endpoints#

  1. Click Configure endpoints in the Edit column.

    Button to navigate to endpoint settings

  2. If all data was entered correctly, the settings will be populated automatically.

    Configuring provider endpoints in Moodle

    If necessary, you can fill in the endpoint URLs manually. See the list of available URLs at: https://<Encvoy ID service address>/api/oidc/.well-known/openid-configuration

Configure User Field Mapping#

  1. Click Configure user field mappings in the Edit column.

    Button to navigate to user field mapping settings

  2. If all data was entered correctly, the settings will be populated automatically.

    Configuring provider user field mappings in Moodle

    If necessary, mappings can be configured manually.

Configure Email Sending in Moodle#

If the LMS requires sending emails to users, you must configure email settings (if not previously set):

  1. Go to Site administration → Server → Email → Outgoing mail configuration.
  2. Fill in the fields:

    • SMTP hosts — the full name of the SMTP server, including the port separated by a colon;
    • SMTP security — select a value from the list;
    • SMTP Auth type — select the required value. If LOGIN authentication type is selected, fill in the SMTP username and SMTP password fields. It is recommended to fill in the No-reply address field to avoid potential issues when sending emails.

    Outgoing mail configuration

💡 Linking a Moodle LMS user with a Encvoy ID user is based on the email address. The absence of an email in the Encvoy ID profile will make authentication in Moodle impossible. Deleting an email address previously linked to Moodle in Encvoy ID and adding a new email address will result in the creation of a new user in Moodle.


Step 3. Verify Connection#

  1. Return to the OAuth 2 services list and ensure that the created provider is active.

    Checking the activity of the created provider

  2. Open the Moodle login page.

  3. Ensure that the Log in using Encvoy ID button has appeared.
  4. Click the button and log in using your corporate credentials:

    • You will be redirected to the Encvoy ID authentication page;
    • After a successful login, you will be redirected back to Moodle as an authorized user.

    Moodle login widget