Valentin Reviglio
Valentin Reviglio

Reputation: 33

Moodle: External user registration with web services

I'm trying to integrate Moodle with an external system, the main idea is that when a user is register to the external system it should be register in Moodle simultaneously.

In order to achieve this, I need to use web services on Moodle, specifically: "auth_email_signup_user"

I followed the instruction from the following Moodle document: Using web services

My idea is to use REST protocol and use the token of Admin user.

However, when I call the register service the Moodle server is returning me:

<?xml version="1.0" encoding="UTF-8" ?>
<EXCEPTION class="moodle_exception">
    <ERRORCODE>registrationdisabled</ERRORCODE>
    <MESSAGE>Registration is disabled on this site</MESSAGE>
</EXCEPTION>

Upvotes: 0

Views: 1061

Answers (1)

Bearzi
Bearzi

Reputation: 558

Does your moodle allow self registration? See https://docs.moodle.org/36/en/Reducing_spam_in_Moodle#Allowing_self-registration

Nevertheless, it would be much more secure writing your own plugin exposing a registration webservice. Also avoid using a admin token, create a custom user and role for this plugin

Upvotes: 1

Related Questions