Using CAS auth on Moodle 2.7, Moodle Mobile launches browser with url moodlemobile://token=someBigRandomString

Using CAS auth on Moodle 2.7, Moodle Mobile launches browser with url moodlemobile://token=someBigRandomString

by Nate Hartmann -
Number of replies: 2

Hello fellow Moodlers,

I've set up the Moodle Mobile additional features using the instructions in the docs, and I've installed a fresh copy of Moodle Mobile 1.10 from Google Play.

Relevant versions info:

  • Moodle 2.7.3+ (Build: 20141218)
  • Galaxy Note 2 w/KitKat (4.4.2)
  • Moto X (also w/KitKat 4.4.2)
  • Moodle Mobile additional features version 2.7.10 (2014060409)

We're using CAS authentication, so I've set "Type of Login" to "Via a browser window".

I open the app and enter my Moodle installation's base URL ( www.myschoolname.edu/moodle2 ) and I get the "You need to log in to the site in a browser window." message as I'd expect. I tap "Yes", and the stock android browser opens with the correct CAS login page.

I log in to CAS with an instructor account (non-admin), and the browser proceeds to the site. I am logged in as the instructor, but I get an unexpected warning "Automatically token generation is not available to site administrators (they must create a token manually in the site)". From there, I can use the mobile website as normal, but I am not directed back to the app.

If I return to the Moodle Mobile app, I am back where I started. I enter the base URL for my Moodle installation, and it prompts me to open a browser again, but now that I already have a CAS session I am immediately directed to the odd-looking URI:

moodlemobile://token=MWM5MzQ4xxxx 

This has a normal looking random token string but of course the browser has no idea how to handle the protocol "moodlemobile".

Because of the unexpected warning about token generation, I paid extra attention to the moodle/webservice:createmobiletoken and :createtoken role overrides, both of which are set to "Allow" for the Authenticated User role.

Has anyone else seen CAS authentication under similar conditions?

Thanks for any input or pointers,

Nate

Average of ratings: -
In reply to Nate Hartmann

Re: Using CAS auth on Moodle 2.7, Moodle Mobile launches browser with url moodlemobile://token=someBigRandomString

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

Hmm,

very strange, I just tried and it's working for me in my test sites. It seems that the app is not recognizing the custom URL scheme. (the app should recognize the protocol and opens inmediately) See: https://github.com/moodlehq/moodlemobile/blob/master/config.xml#L102

 I'm not sure if this will be ok for you but in order to help you I'd need a test user account (no need to be enrolled in any course), you can send me the account via a private message.

Cheers, Juan

In reply to Juan Leyva

Re: Using CAS auth on Moodle 2.7, Moodle Mobile launches browser with url moodlemobile://token=someBigRandomString

by Nate Hartmann -

Thanks for your reply, Juan, and for your generous offer to help me test.

Fortunately/unfortunately I can no longer reproduce this error on either my 2.7 or 2.8 Moodle instances, so I suppose I'll shelve this until I hear another report of it.


Best,

Nate