Problem with Moodle mobile app

Problem with Moodle mobile app

by Nick Brown -
Number of replies: 3

We have a Moodle 2.9 (Build: 20150511) server at http://moodle2.rncb.ac.uk. This is running on IIS and MySQL with SSL enforced for logging in, and NTLM SSO enabled for the local network. Users are authenticated via LDAP. It works well for browser users.

When we try to connect the Moodle mobile app, it gets as far as authenticating the user (and fails if the user isn't valid) but then displays the following error message "Cannot connect:  Verify that you have typed correctly the URL and that your site uses Moodle 2.4 or later."

The log for the user concerned seems to show that tokens are working OK, but offers no further insight that i can see:

  • 20 May, 08:59 The web service function 'core_webservice_get_site_info' has been called.
  • 20 May, 08:59 The user with id '12' has been sent the web service token with id '2'. 

I have read other forums posts about debug logging (not switched on) and SSL problems (our certificate is good, I think), but cannot fathom out why it won't go any further.

Is anyone able to offer a suggestion? I am not an experience Moodle admin!

Thanks, Nick Brown.

Average of ratings: -
In reply to Nick Brown

Re: Problem with Moodle mobile app

by Juan Leyva -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Nick,

can I have a test user account to see what is happening in my development environment?

If it's possible, you can send me the credentials via private messaging.

Regards, Juan

In reply to Juan Leyva

Re: Problem with Moodle mobile app

by Nick Brown -

I have done so, thanks very much for your help.

In reply to Nick Brown

Re: Problem with Moodle mobile app

by Juan Leyva -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Nick,

it's interesting to see that requests using HTTPS works with the mobile app but using HTTP doesn't work.

Sample request that works:
  1. Request URL:
  2. Request Method:
    POST
  3. Status Code:
    200 OK

and this one doesn't work:
  1. Request URL:
  2. Request Method:
    POST
  3. Status Code:
    401 Unauthorized
  4. Request Headersview source


The main difference is that the app uses HTTPS for requesting the token and do a first request for retrieve the site settings, in that moment, your Moodle site says that he uses http:// so the app switch to use http:// and then when the app tries to do something, a web server authentication form is displayed (it request username and password).

In order to solve this, I see to options:

- Use HTTPS for the whole site, not only for authentication

- Use the local_mobile plugin, see: https://docs.moodle.org/28/en/Moodle_Mobile_additional_features this will force your uses to authenticate in the Moodle site for retrieving a token

Hope it helps, Juan