Quantcast
Channel: Web services
Viewing all articles
Browse latest Browse all 2361

Re: Moodle login after remote authentication

$
0
0
by Nathan Mcilree.  

I am not sure if the Web Services provide authentication services - I did a quick search through the functions under for "auth" or "log" and came back with nothing.

I guess the proper way to do this would be to develop an auth plugin. 

I implemented a slightly more hacky version for the company I work for which I will describe below in case it is of assistance.

Scenario
User logs onto our bespoke web platform , when they click across to MOODLE they are background authenticated at that point (or new account created if they do not have a local MOODLE account).

Process

  1. On login to our bespoke web platform cookie is assigned to user (this relies on shared sub domains - but other mechanisms could be substituted).
  2. When a user hits MOODLE config.php checks for this cookie - if present it makes note of page user was trying to go to and forwards user to custom background login page.
  3. Custom login page calls user details via our own web services using cookie as ID.
  4. User is loaded via a common id to both systems (we use id number as the shared field) using the MOODLE function :
    $user = get_complete_user_data('idnumber', $returned_id);
  5. If a result is returned then call MOODLE function
    complete_user_login($user);
  6. Following this the user is forwarded to the original page they were requesting.

This is a replacement for a previous even hackier authentication method where on login to our bespoke system the username would be saved in a database with a guid key and then the user forwarded to a specific MOODLE key which would retrieve the user details from aforementioned database, used to log user into MOODLE, and then return user to bespoke system.


Sorry if kind of track - but thought there might be a chance it is of use to you.




Viewing all articles
Browse latest Browse all 2361

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>