by Christian Hansen Nørgaard.
Hi.
I am having a hard time deciphering exactly how the courses for a user via CAS authentication is processed in the Moodle Mobile retrieved from git here: https://github.com/moodlehq/moodlemobile2
The reason I am looking through the code is to find exactly how it's able to get my token (or something else crucial to retrieving user data?). So far I've found the following when using the app:
1. Entering the site url works and I am being redirected to a CAS login page
2. When entering my credentials on the CAS login page I am redirected to Moodle as expected
3. The first page I see is a list of all my courses
So the above works like a charm but I need to know how it's able to redirect me back to Moodle and find my courses. If I try to use the API function: https://MOODLESITE/login/token.php?username=USERNAME@DOMAIN&password=PASSWORD&service=moodle_mobile_app, I am not able to get my own token. So how exactly does it use the function: core_course_get_courses, based on my CAS login?
The last thing I can see the app do is use the method of "openInApp", where it presents the CAS login in a browser. I haven't been able to catch or grab the next step where it redirects me to Moodle.