Moodle Authentication Using an External Web Service

Moodle Authentication Using an External Web Service

by SECOMV EMARF -
Number of replies: 5

Hi, Folks,


I have an external web service for authentication in my company and I'd like to connect Moodle with it, but I'm not being able to do it.


When I activate the web service authentication plugin, I see the message that I cannot use it exclusively with web accounts. 


Maybe it's a newbie or stupid question, but I didn't understand why... can y ou explain it?


Thanks,

Luiz




Average of ratings: -
In reply to SECOMV EMARF

Re: Moodle Authentication Using an External Web Service

by Daniel Neis Araujo -
Picture of Core developers Picture of Plugin developers Picture of Translators

Hello,


as far as I know, the standard "webservices authentication" of Moodle is used to authenticate consumers of Moodle's webservices.


If you are interested in authenticating users against an external webservice, you may take a look at

https://github.com/danielneis/moodle-auth_ws/


It works with SOAP, but feel free to make it work with REST and other protocols and submit a pull request =)


Kind regards,

Daniel

In reply to Daniel Neis Araujo

Re: Moodle Authentication Using an External Web Service

by SECOMV EMARF -

Hi, Daniel,


It seems it's what I am looking for, but I didn't understand how to setup it. Can you give me any advice, please?


Thank you very much.

Luiz

In reply to SECOMV EMARF

Re: Moodle Authentication Using an External Web Service

by Daniel Neis Araujo -
Picture of Core developers Picture of Plugin developers Picture of Translators

Hello,


after you install the plugin, you should see the new settings, but if it not happen, got to the following URL on your moodle:

moodle/admin/settings.php?section=manageauths

Enable the "External webservice authentication" plugin and click the link to go to it's settings, or access the following URL on your moodle:

moodle/admin/auth_config.php?auth=ws

Now, you will need the following from your SOAP webservice, in same order of settings page:

  • The URL of your server. Note that the ?wsdl prefix will be added if needed.
  • A set of parameters that may be sent in every call (maybe moodletoken:abfbFba5asas5cs5asc)
  • The name of the function to use to authenticate users
  • Name of the paramater to send username as to the webservice.
  • Name of the paramater to send password as to the webservice.
  • The name of the class containing the result of webservice.
  • The field of the class containing boolean the result of webservice.

You may see an form with sample data at:

https://raw.githubusercontent.com/danielneis/moodle-auth_ws/master/moodle-auth_ws_settings.png

If you have any other doubts, please let me know.


Kind regards,

Daniel

In reply to Daniel Neis Araujo

Re: Moodle Authentication Using an External Web Service

by SECOMV EMARF -

Hi, Daniel,


I tried to install it using plugin install option, but I got an error message of name mismatch.

I unzipped, renamed plugin's main directory as "auth_ws" and tried again. This time I got a different error message (see added file).


By the way, I'm using 2.9.1 version.


Thank you.

Luiz

Attachment error.gif
In reply to SECOMV EMARF

Re: Moodle Authentication Using an External Web Service

by Daniel Neis Araujo -
Picture of Core developers Picture of Plugin developers Picture of Translators

Hello,


don't know about this install option, and because the plugin still is not on plugins database, it really should not work.

You must put the code in moodle/auth/ws and it will work =)


Kind regards,

Daniel