Forums | Mahara Community
Support
/
Login into Mahara-App with "Mahoodle" (Token)
12 January 2019, 3:34
Hello,
We've a Moodle (version 3.5.3+) and a Mahara (version 18.10) connected via mnet.
I want to log in to the Mahara App and get two error messages:
1 "Unable to login to server. Is the server address correct?" (--> it is correct)
Two. "Unable to sync date with the server."
If I want to log into the app as admin via local login, I only get the 2nd error message. Even as an admin I can't use the app.
I have activated the web service and the "Rest" protocol in Mahara. Also Mahara Mobile API and there user token access.
...
I use the iOS app on my iPhone.
Do you have any idea why this might be?
Stefanie
14 January 2019, 8:31
Hi Stefanie,
Can you please disable the web services that you activated and do the setup via Admin menu -> Extensions -> Plugin administration -> Mobile API?
https://manual.mahara.org/en/18.10/administration/extensions.html#module-mobile-api
That is the best way to ensure that all settings are made correctly.
Was the second error message "Unable to sync date with the server." or was "date" supposed to be "data"?
Cheers
Kristina
14 January 2019, 23:06
Dear Kristina,
thank you so much for the tip.
I've deactivated the webservice and then it automatically configured it via"Extensions -> Plugin administration -> Mobile API".
But the result is the same.
I've done the "Web service test client" with the token of a user
Protocol: REST
Authentication type: Token
Service: Mahara Mobile API (Token)
Functions: module_mobileapi_sync
and got this results:
array (
'url' => 'https://mahara.hu-berlin.de/webservice/rest/server.php?wstoken=ee0d424df53d35216b06f003fcc7efb3&wsfunction=module_mobileapi_sync&alt=json',
'results' =>
array (
'error' => true,
'error_number' => 500,
'error_name' => 'Ungültiger externer API Parameter: key: notifications - Ungültiger Parameterwert entdeckt; die Ausführung kann nicht fortgesetzt werden. : Vorausgesetzter Schlüssel fehlt in einzelner Struktur: lastsync',
'error_class' => 'WebserviceParameterException',
'error_message' => 'Ungültiger externer API Parameter: key: notifications - Ungültiger Parameterwert entdeckt; die Ausführung kann nicht fortgesetzt werden. : Vorausgesetzter Schlüssel fehlt in einzelner Struktur: lastsync',
'error_rendered' => 'Ungültiger externer API Parameter: key: notifications - Ungültiger Parameterwert entdeckt; die Ausführung kann nicht fortgesetzt werden. : Vorausgesetzter Schlüssel fehlt in einzelner Struktur: lastsync',
),
'inputs' =>
array (
'blogs' =>
array (
),
'folders' =>
array (
),
'notifications' =>
array (
'types' =>
array (
),
),
'tags' =>
array (
),
'userprofileicon' =>
array (
),
),
)
Which key versus which parameter in which structure could be meant?
All the best and thanks
Stefanie
18 January 2019, 9:19
Hello Stefanie,
Thank you for the additional information. We'll see if we can replicate the issue. The account that you are planning to log into, is it only connected to MNet or is there another authentication method in play?
Cheers
Kristina
29 January 2019, 2:17
Thanks a lot, Kristina,
you're right, our users log into Moodle and from there they get access to Mahara via MNET.
Best regards
Stefanie
13 February 2019, 20:49
Hi Stefanie,
Sorry for the long wait. I can use the mobile app token successfully on my Moodle to Mahara, and it's a Moodle 3.6. The Moodle version shouldn't matter.
I did see in one of your screenshots, the one that shows the service groups, that you are missing a whole bunch that are needed for the mobile API. In my Mahara, I have the following:
module_mobileapi_sync, module_mobileapi_get_blogs, module_mobileapi_get_folders, module_mobileapi_get_notifications, module_mobileapi_get_tags, module_mobileapi_get_user_profile, module_mobileapi_get_user_profileicon, module_mobileapi_upload_file, module_mobileapi_upload_blog_post
You only seem to have module_mobileapi_get_blogs configured. I'm afraid I don't know why you wouldn't have the other service groups set up as well. When I'm on a clean install of Mahara, I do have all these service groups available by default and thus don't have an explanation why they are not there for you. Did you by any chance remove them manually at some point?
Cheers
Kristina