Forums | Mahara Community
Support
/
Unable to add 'webservice' as authentication type
14 December 2022, 23:56
Mahara 22.10
I'm attempting to set up LTI *in* to Mahara from Moodle on a test site and I'm having problems. I've done it before and I can't work out where I'm going wrong.
I'm getting a message, "Web service authentication is not enabled for this institution"
On my working site, one of the Authentication types for the institution (I only have one) is 'Webservice'. However, there is no option to add this on the problem site..
I've checked webservices are enabled and I can't see anything wrong.
My working site does not have those two 'External app' entries - which is even more confusing.
What have I (not) done?
15 December 2022, 1:07
Actually, on further investigation, I think this is a bug.
Let me explain...
Those external app things are webservice logins. I assume this is a change in 22.10? Anyway, there are two, one for LTI and one for the Assignment submission. The database table looks like this...
However, on login a check is made that webservice logins are enabled. This is done in module/lti/webservice/functions/module_lti_launch.php at line 106
The issue is that the get_field() call is only expecting a single entry for 'webservice'. It's finding two and that causes it to return 'false'. Therefore the AccessDeniedException() is executed.
So either the check should allow multiple instances of the webservice auth or whatever added two should not have done in the first place.
15 December 2022, 16:54
Hi Howard,
This is a timely question that Robert had been looking into today because we have come across it as well during a a site upgrade. Yes, it is a bug and we are working on a solution. Basically, at the moment when you upgrade an existing site where you could have multiple LTI auth methods, it only allows a 1-1 relationship, but we need to be able to have multiple LTI auth in one organisation.
The quick fix: If you don't need both of them, remove one auth method until the fix is there. I've seen at times that the 'normal' LTI launch is added to an institution and then also a second one for the Moodle assignment submission plugin. Since the lti_launch is included in the call for the plugin, only one LTI auth instance is needed instead of having two of them in there.
Please keep an eye on the bug report as our code review system will put a note on it when a patch is ready for testing. Your testing would be appreciated to give us anothe data point.
Thank you
Kristina
15 December 2022, 17:07
Hi Howard,
Turns out, we already had a patch that we merged today. It would still be good if you tested it so we have another test.
Many thanks
Kristina
15 December 2022, 23:05
Sorry - I've given it my best shot but your bug tracking system is completely opaque to me. Can you explain where I can find the updated code?
EDIT:
Still no idea, but I found the 22.10_DEV branch in which I can see some changes. I'll check that out and give it a go.
Thanks :)
16 December 2022, 4:08
Seems to work now - with the two webservice auth types.
I still can't get Moodle Assignments to work - see https://mahara.org/interaction/forum/topic.php?id=9231 . I'm going to do a bit more digging, though