I am a beginner in android and developing a Moodle app as my university project. I've creted a Login form which should call the php page and logs in. I saw the topic:
How to get a user token
Moodle 2.2
Your client can call the script located in /login/token.php with a simple HTTP request. We highly recommend to do it securely with HTTPS. The required parameters are:
- username
- password
- service shortname - The service shortname is usually hardcoded in the pre-build service (db/service.php files). Moodle administrator will be able to edit shortnames for service created on the fly: MDL-29807. If you want to use the Mobile service, its shortname is moodle_mobile_app. Also useful to know, the database shortname field can be found in the table named external_services.
Call: https://www.yourmoodle.com/login/token.php?username=USERNAME&password=PASSWORD&service=SERVICESHORTNAME //Moodle mobile service shortname => moodle_mobile_app
and made a call to token.php using HttpClient but it does not returns a token in response. It returns an error i.e "error":"unsupported redirect detected, script execution terminated". Can somebody help me, please.