Moodle user login with external API

Moodle user login with external API

by Tom Stallings -
Number of replies: 2
Hi all, need a little guidance or where to look for some information to get some things to work.  Basically what I need to happen is when a user logins, they are authentication to an outside website via API using REST.  Once they authenticate, they are taking to their Student page and can see their course progress, completion etc. (from external site)  I believe once I figure out the login and registering piece, the rest I can figure out.

Here is an example PHP code the execute properly: (This is the login)

https://moodle.org/pluginfile.php/71946/mod_forum/post/1286482/logintest.php

Here is an example user create PHP

https://moodle.org/pluginfile.php/71946/mod_forum/post/1286482/create%20user.php


Average of ratings: -
In reply to Tom Stallings

Re: Moodle user login with external API

by Olumuyiwa Taiwo -
Picture of Plugin developers

Hi Tom,

You could start by looking at https://docs.moodle.org/dev/Authentication_plugins and https://docs.moodle.org/29/en/Authentication. You may also want to read the code of one of the core authentication plugins - the webservice one might be a good one in your case.

In reply to Olumuyiwa Taiwo

Re: Moodle user login with external API

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

Hello,


you may be interested in https://github.com/danielneis/moodle-auth_ws/

It currently work only with SOAP, but may be trivial to adapt it to support REST too (pull requests are welcome) ;)

There is also another recent forum discussion about this at https://moodle.org/mod/forum/discuss.php?d=319421


Kind regards,

Daniel

Average of ratings: Useful (1)