Web Service client login + session creation

Web Service client login + session creation

by jerrett fowler -
Number of replies: 1

Hello I'm trying to use a third party application that I've created to be able to log into moodle, get a proper session, and then be able to interact with the system via a token.

The logical flow for logging in would be the following:

  1. Client sends username/password over to moodle
  2. Moodle returns a token and creates a session in Moodle
  3. Client is then able to list courses, and if a course link is clicked on, be able to seamlessly go to Moodle.

The logical flow for logging out would be the following:

  1. Client initiates logout
  2. Moodle logs out user, deletes session


If this isn't possible, Im actually in the process of creating my own auth plugin with web services and I'm having a bit of trouble on the session side. I'd like to:

  1. Create a session
  2. Delete a session/log person out

I've not found any information on cleanly logging a user out based on sessionid?

Any help is appreciated.
Average of ratings: -
In reply to jerrett fowler

Re: Web Service client login + session creation

by Jerry Kalkhof -

Here is an example curl call I use to login and get a token:

curl -k -X GET 'https://localhost/moodle/login/token.php?username=student&password=password!&service=moodle_mobile_app'