Login API

Login API

by Stefano Fiscale -
Number of replies: 1

Hi,

I'm developing a mobile app for my university that uses moodle web services.

I've read API documentation and I didn't find anything about login web services and this is a big problem.

I want that a user, in my app login module, digits his credentials and through a moodle web service I can establish if that credentials are correct or less.

Can anyone help me?

Thanks in advance,

Stefano.

Average of ratings: -
In reply to Stefano Fiscale

Re: Login API

by Stefano Fiscale -
For those who have had the same problem, here's the solution:

from terminal execute the following command:
$ curl -c - -i -F'username=myusername' -F'password=mypassword' -F'service=moodle_mobile_app' -X POST http://mymoodlesite/login/token.php

The response will be something like:
{"token":"696ded7cd77a8041c0332423a9e8c78b","privatetoken":null}#