External service Login

External service Login

by Olivier Plante -
Number of replies: 3

Hi,


I'm looking to list all courses with External Service and use the Moodle's url provided by the web service to show courses. But when I tried to access this url I have this message "You are not logged in". I want to log in before showing this page.


Is it possible to request an authentication token or something I can use to authenticate before showing any Moodle page.


Thanks

Average of ratings: -
In reply to Olivier Plante

Re: External service Login

by John Okely -

I may be misunderstanding, but I feel like you are mixing two different concepts here. Accessing moodle via the APIs is what I'd expect you to be doing in your app. There should be no need to access the site directly via the front end.

If there's something you are trying to do that cannot be done with the current web services then you can request that gets added (and even help develop it). But the content of courses and modules can be requested already with existing web services. Is that what you are trying to do?

In reply to John Okely

Re: External service Login

by Olivier Plante -

Sorry I explained my problem badly. I have no problem getting the list of courses and modules. What I want is to show the module itself (quizz, lesson, survey, ...). To show them those modules I want to redirect to the Moodle site without the need to login again. Is it possible? Thanks

In reply to Olivier Plante

Re: External service Login

by John Okely -

There are external functions to interact with each module already. For instance, you can use the view_page external function to see a page.

If you cannot work all of that functionality in your app, why not fork it from moodlemobile2?

What you're talking about here seems to be single sign on. You could also consider signing into cas in your application and use cas authentication on your moodle. But I think you're trying to solve the wrong problem here.