Hey folks, I'm interested in mocking up a basic moodle client using Flex… It looks to me like the official moodle iPhone app can auth using a users username and password, can anyone point me to doc on how this is done?
Using a packet sniffer I discovered that the iPhone client posts to:
http://yourmoodleserver.com/<path-to-moodle>/login/token.php
With a POST body of:
username=<username>&password=<password>&service=moodle_mobile_app
Assuming valid username and password this will return a token that can be used for this user.
subsequently the client calls:
with an xml rpc body that requests the: moodle_webservice_get_siteinfo function/method like so:
<?xml version="1.0"?><methodCall><methodName>moodle_webservice_get_siteinfo</methodName><params></params></methodCall>
In my case I'm using rest so instead of xmlrpc in the url I have rest and I append &wsfunction=moodle_webservice_get_siteinfo
I had to enable REST access for all authenticated users, which I did via: Site administration > Users > Permissions > Define roles > Authenticated user
http://docs.moodle.org/20/en/Integration_FAQ might give you some additional pointers.
hth
Frank
Thanks for the pointer Frank, I didn't find anything on that page directly related to my question. Are there particular links on there that I should follow up on?
TIA!
Please help me login moodle using REST via android app.