Authenticate with Moodle from a mobile app
问题 My mobile app needs to log in to Moodle to get Json data from a webservice and display it using Angular. In order to do that, I need to pass in a username and password and get a Moodle webservice token back, so my app doesn't need to log in again (at least until the token expires). (this is one of those "ask and answer your own question" things, so my solution is below, but comments & suggestions welcome.) With thanks to all the other StackOverflow pages I have used to create this solution!