by Sebastian Beetschen.
Hi,
I ran in the same question.
How I understand it, to get a token, you have to call the (e.g. Shibboleth) unprotected https://www.yourmoodle.com/login/token.php?username=USERNAME&password=PASSWORD&service=SERVICESHORTNAME
However, the official moodle app first opens the login page of (in our case Shibboleth) and then gets the token. What is still don't get is how the username and password are automatically inserted.
Here are resources that I found and might help you;
https://docs.moodle.org/dev/Creating_a_web_service_client
https://tracker.moodle.org/browse/MOBILE-113?jql=project%20%3D%20MOBILE%20AND%20text%20~%20cas
https://docs.moodle.org/32/en/Moodle_Mobile_guide_for_admins