---
title: "WT JMoodle User sync plugin for Joomla 5 and Moodle Single Sign On - WebTolk websites development, Joomla Extensions"
description: "A plugin for synchronizing Joomla and Moodle users. Single Sing On (SSO) for Joomla and Moodle. Free download."
url: "https://web-tolk.ru/en/dev/joomla-plugins/wt-jmoodle-user-sync"
date: "2026-06-13T22:27:06+00:00"
language: "en-GB"
---

# WT JMoodle User sync

- **Categories:** [Joomla plugins](https://web-tolk.ru/en/dev/joomla-plugins), [Joomla 4 - Joomla 6extensions](https://web-tolk.ru/en/dev/rasshireniya-dlya-joomla-4), [Moodle](https://web-tolk.ru/en/dev/moodle)
- **Version:** 1.1.0
- **Date:** 09 April 2024

4440 3754 CTR 118% Plg Free

[Download](https://web-tolk.ru/en/get?element=wtjmoodleusersync)[Versions](https://web-tolk.ru/en/dev/joomla-plugins/wt-jmoodle-user-sync/versions)[GitHub](https://github.com/WebTolk/WT-JMoodle-user-sync)[JED](https://extensions.joomla.org/extension/living/education-a-culture/wt-jmoodle-user-sync/)

A plugin for synchronizing Joomla and Moodle users. Single Sing On (SSO) for Joomla and Moodle.

![WT JMoodle User sync](https://web-tolk.ru/images/swjprojects/projects/80/en-GB/icon.webp)

## Description

First of all, I want to mention an already existing solution to the same problem - [Joomdle component](https://joomdle.com). This extension was considered as a possible way to solve the problem of integrating Joomla and Moodle, including single sign-on. Some approaches were then "spied on" in it (the GPL license allows this).

However, Joomdle appeared around 2008-2009 and has changed little internally since then. Under the hood of this component is code that uses (at the time of writing this text in January 2024) the methods of Joomla 1.6-2.5. This means that on Joomla 5, if it will work without errors, then only with the backward compatibility plugin. And it won't work on Joomla 6 anymore. The developer has declared the functionality of the component on Joomla 4.

Since the codebase of the component and related plugins is quite large, its upgrade to modern Joomla standards is unlikely to happen soon, if at all. It should also be borne in mind that Moodle also did not stand still and it has a fairly developed REST API, while Joomdle used its entry point to LMS Moodle bypassing the REST API. This has historically happened due to the fact that Joomdle added its functionality probably before it appeared in the REST API Moodle.

Therefore, it was decided to create a library **WT JMoodle library** to work with the Moodle REST API from Joomla, as well as to create plugins to solve various tasks for working with Moodle from Joomla that will use this library.

### Plugin dependencies

The plugin requires an installed and configured library to integrate Joomla 4 / Joomla 5 and Moodle - WT JMoodle library.

### Plugin features

- creating a Moodle user when creating or self-registering a Joomla user
- updating Moodle user data when updating Joomla user data. So far, standard user data is being synchronized: name, login, password, etc. Mapping of user fields has not yet been implemented.
- deleting a Moodle user when deleting a Joomla user
- SSO - Single Sign On - single sign-on for both engines (on cookies). Optional.

### Synchronization of Joomla 4 / Joomla 5 and Moodle 4.3 users

Data synchronization occurs automatically at the time of actions on users in Joomla. The database contains a table of links between Joomla and Moodle users, which is created when installing the **WT JMoodle** library. On the Moodle side, the external service needs to be allowed to use методов `core_user_create_users` , `core_user_update_users` , `core_user_delete_users` .

You can check if they are available for the current configuration in the plugin **User - WT JMoodle User sync**.

![Moodle and Joomla integration plugins in Joomla 5](https://web-tolk.ru/en/dev/joomla-plugins/images/development/joomla/plugins/wtjmoodleusersync/0-en.webp)

 ![In the parameters of the wt moodle user sync plugin, you can see if the necessary Moodle REST API methods are available](https://web-tolk.ru/en/dev/joomla-plugins/images/development/joomla/plugins/wtjmoodleusersync/1-en.webp)In the parameters of the WT JMoodle user sync plugin, you can see if the necessary Moodle REST API methods are available

### SSO (Single Sign On) for Joomla and Moodle

#### Introduction

Single sign-on technology is used by those companies that have multiple sites and services for their users. We are all used to the fact that Google, Yandex, VK (Mail.ru ) and other large sites allow us to use the same account (account) for all their services (mail, advertising account, social network, etc.). Usually for the tasks of storing user credentials, authorization (login / logout) and interaction with other services of the company, a separate service (website) is allocated, which is called the **Identity portal**. In the diagram below, it is designated **SSO**.

 ![SSO schema](https://web-tolk.ru/en/dev/joomla-plugins/images/development/joomla/plugins/wtjmoodleusersync/sso.webp)SSO on the schema -Identity portal.

And in this case, if we have only 2 sites (Joomla and Moodle), then to manage users, we need to raise another portal site - **identity portal**. If there are only 2 sites, such a solution will be rather redundant and it is easier to set up direct data synchronization between the two engines. If the prospect of growth to several independent services is assumed, then in this case you need to configure the classic SSO.

**This plugin is a solution for direct integration of Joomla and Moodle without using Identity portal, it is not inherently a classic SSO, but provides this functionality.**

#### Single sign-on scheme for Joomla 5 and Moodle 4.3 when using the WT JMoodle user sync plugin

![Joomla 5 and Moodle 4.3 authorization scheme](https://web-tolk.ru/en/dev/joomla-plugins/images/development/joomla/plugins/wtjmoodleusersync/scheme.webp)

When a user logs in on the Joomla side, authorization on the Moodle side occurs according to the following scheme:

1. When a user logs in to Joomla, the onUserAfterLogin plugin sends a request to the WT JMoodle auth authentication plugin on the Moodle side. The request includes a token created for the Moodle REST API and specified in the settings of the WT JMoodle library.
2. The WT JMoodle auth authentication plugin on the Moodle side checks: 1. is the token in the request empty 2. has a token been created for an external service whose id is specified in the settings of the WT JMoodle auth plugin on the Moodle side. 3. Compares whether the token in the request matches the token in the database for this external service. 4. Checks whether the user specified in the request exists in Moodle.
3. If all previous checks are successful, the WT JMoodle auth plugin on the Moodle side in turn makes a request to Joomla to verify whether the requested user is actually logged in to Joomla? The request also contains a token for the web service.
4. Joomla checks if this user is logged in and gives a Moodle response.
5. On the Moodle side, the authentication plugin receives a response from Joomla and if the user is really logged in to Joomla, it authorizes the user on the Moodle side and sends a cookie to Joomla.
6. This way, you can log in to both sites at the same time.
 ![Authentication plugin settings WT JMoodle auth](https://web-tolk.ru/en/dev/joomla-plugins/images/development/joomla/plugins/wtjmoodleusersync/03-en.webp)Plugin settings authentication WT JMoodle auth, which is set in Moodle.

### Cookie domain setting for SSO to work

In order for this authorization scheme to work, **Moodle and Joomla must be on the same level 2 domain**. Usually a Joomla site is located on the main domain of the 2nd level, for example `site.ru`. There are 2 possible locations for Moodle:

1. On a subdomain like`moodle.site.ru`.
2. In the subfolder of the main site like `site.ru/moodle`.

If Moodle is located in a subfolder, cookies issued by both systems by the browser will be perceived as cookies of the same site. While `site.ru` and `moodle.site.ru` - different sites and cookies of one will not be available to the other.

**However, in both systems - both Joomla and Moodle - there is a parameter in the settings "cookie domain". In both engines, you need to specify a level 2 domain in this parameter, for example,** `site.ru`.

 ![Cookie domain parameter in Moodle 4.3](https://web-tolk.ru/en/dev/joomla-plugins/images/development/joomla/plugins/wtjmoodleusersync/04-en.webp)The cookie domain parameter in Moodle 4.3

If Joomla is located on a level 2 domain, and Moodle is on a subdomain, then you can omit this parameter on the Joomla side. If Joomla is also on a subdomain, then this setting is required. Go to the left menu **System / General settings / Site tab / at the very bottom of the page**.

 ![The cookie domain parameter in joomla 5](https://web-tolk.ru/en/dev/joomla-plugins/images/development/joomla/plugins/wtjmoodleusersync/05-en.webp)The cookie domain parameter in Joomla 5.

## Joomla

 **Extension type:** Plugin **Folder:** User **Joomla version:** 5.0.0, 5.0.3

## Gallery

![...](https://web-tolk.ru/en/dev/joomla-plugins/images/swjprojects/projects/80/en-GB/gallery/iHMpGiEd2P6.webp)

## What's new

 2024-04-09 18:16:44

Addition

### Username can be an e-mail

It has become possible to use the user email as username when using SSO. On the Joomla side, third-party plugins are usually used for this. On the Moodle side, the parameter must be used Allow log in via email authloginviaemail

Addition

### SSO: log out

When logging out of Joomla, the user logs out of Moodle at the same time. To do this, install the version of the authentication plugin jmoodle 1.1.0 (20240409)

Change

### Code refactoring

The code has become simpler and more reliable.

---

## Related extensions

[!\[WT JMoodle library\](https://web-tolk.ru/images/swjprojects/projects/79/en-GB/icon.webp) WT JMoodle library](https://web-tolk.ru/en/dev/biblioteki/wt-jmoodle-library-for-cms-joomla-and-lms-moodle-rest-api-connection)

[!\[WT JMoodle auth for Moodle\](https://web-tolk.ru/images/swjprojects/projects/81/en-GB/icon.webp) WT JMoodle auth for Moodle](https://web-tolk.ru/en/dev/moodle/wt-jmoodle-auth-plagin-dlya-moodle)

## JSON-LD Schema

```json
{
    "@context": "https://schema.org",
    "@type": "BreadcrumbList",
    "@id": "https://web-tolk.ru/#/schema/BreadcrumbList/17",
    "itemListElement": [
        {
            "@type": "ListItem",
            "position": 1,
            "item": {
                "@id": "https://web-tolk.ru/en",
                "name": "Home"
            }
        },
        {
            "@type": "ListItem",
            "position": 2,
            "item": {
                "@id": "https://web-tolk.ru/en/dev",
                "name": "Joomla extensions"
            }
        },
        {
            "@type": "ListItem",
            "position": 3,
            "item": {
                "@id": "/en/dev/joomla-plugins",
                "name": "Joomla plugins"
            }
        },
        {
            "@type": "ListItem",
            "position": 4,
            "item": {
                "name": "WT JMoodle User sync"
            }
        }
    ]
}
```

```json
{
    "@context": "https://schema.org",
    "@graph": [
        {
            "@type": "Organization",
            "@id": "https://web-tolk.ru/#/schema/Organization/base",
            "name": "WebTolk",
            "url": "https://web-tolk.ru/",
            "logo": {
                "@type": "ImageObject",
                "@id": "https://web-tolk.ru/#/schema/ImageObject/logo",
                "url": "images/webtolk-1080p.jpg",
                "contentUrl": "images/webtolk-1080p.jpg",
                "width": 1920,
                "height": 1080
            },
            "image": {
                "@id": "https://web-tolk.ru/#/schema/ImageObject/logo"
            },
            "sameAs": [
                "https://github.com/WebTolk",
                "https://github.com/sergeytolkachyov",
                "https://vk.com/web_tolk",
                "https://vk.com/webtolkru",
                "https://tenchat.ru/sergeytolkachyov",
                "https://t.me/sergeytolkachyov",
                "https://t.me/webtolkru"
            ]
        },
        {
            "@type": "WebSite",
            "@id": "https://web-tolk.ru/#/schema/WebSite/base",
            "url": "https://web-tolk.ru/",
            "name": "WebTolk websites development, Joomla Extensions",
            "publisher": {
                "@id": "https://web-tolk.ru/#/schema/Organization/base"
            }
        },
        {
            "@type": "WebPage",
            "@id": "https://web-tolk.ru/#/schema/WebPage/base",
            "url": "https://web-tolk.ru/en/dev/joomla-plugins/wt-jmoodle-user-sync",
            "name": "WT JMoodle User sync plugin for Joomla 5 and Moodle Single Sign On - WebTolk websites development, Joomla Extensions",
            "description": "A plugin for synchronizing Joomla and Moodle users. Single Sing On (SSO) for Joomla and Moodle. Free download.",
            "isPartOf": {
                "@id": "https://web-tolk.ru/#/schema/WebSite/base"
            },
            "about": {
                "@id": "https://web-tolk.ru/#/schema/SoftwareApplication/base"
            },
            "inLanguage": "en-GB",
            "breadcrumb": {
                "@id": "https://web-tolk.ru/#/schema/BreadcrumbList/17"
            }
        },
        {
            "@type": "SoftwareApplication",
            "name": "WT JMoodle User sync",
            "url": "https://web-tolk.ru/en/dev/joomla-plugins/wt-jmoodle-user-sync",
            "description": "A plugin for synchronizing Joomla and Moodle users. Single Sing On (SSO) for Joomla and Moodle.",
            "applicationCategory": "Joomla plugins",
            "softwareVersion": "1.1.0",
            "downloadUrl": "https://web-tolk.ru/en/get?element=wtjmoodleusersync",
            "image": "https://web-tolk.ru/images/swjprojects/projects/80/en-GB/icon.webp",
            "operatingSystem": "ANY",
            "interactionStatistic": [
                {
                    "@type": "InteractionCounter",
                    "interactionType": "https://schema.org/DownloadAction",
                    "userInteractionCount": 4440
                },
                {
                    "@type": "InteractionCounter",
                    "interactionType": "https://schema.org/ViewAction",
                    "userInteractionCount": 3755
                }
            ],
            "mainEntityOfPage": {
                "@type": "WebPage",
                "url": "https://web-tolk.ru/en/dev/joomla-plugins/wt-jmoodle-user-sync"
            },
            "softwareRequirements": "Joomla",
            "applicationSubCategory": "Joomla plugins, Joomla 4 - Joomla 6extensions, Moodle",
            "isAccessibleForFree": true
        }
    ]
}
```
