How to log in to moodle through REST api from another web application?

How to log in to moodle through REST api from another web application?

by Pinki Naskar -
Number of replies: 5

I want to log in to moodle through REST api from another open source application.

Please suggest me how  I will proceed.

 

Thank You....

Average of ratings: -
In reply to Pinki Naskar

Re: How to log in to moodle through REST api from another web application?

by Jérôme Mouneyrac -
Hi Pinki,
if you are asking about how to create a client using the REST protocol, there are few documentation links at top of this forum : http://moodle.org/mod/forum/view.php?id=6971. Through them you should find enough information and examples.

http://docs.moodle.org/dev/Web_services
http://docs.moodle.org/dev/Creating_a_web_service_client
https://github.com/moodlehq/sample-ws-clients
Average of ratings: Useful (1)
In reply to Jérôme Mouneyrac

Re: How to log in to moodle through REST api from another web application?

by Pinki Naskar -

Thank You Jerome.

I have tried it by the function core_webservice_get_site_info and it returns information of moodle sitename,username etc.

But I want to get access in to moodle directly from a different web service which acts as client. The username and password of the moodle will be send from the client.

In reply to Pinki Naskar

Re: How to log in to moodle through REST api from another web application?

by Andrew Solomon -

Hi Pinki

Once the user is logged in, would you like them to be viewing their Moodle home page? In this case (I think) you just need to replicate in your own client the POST request produced by the Moodle login page.

If you don't want them to wind up at the Moodle home page, what will you be doing with the login?

Andrew

In reply to Andrew Solomon

Re: How to log in to moodle through REST api from another web application?

by Stefan Kittel -

Hello,

sorry to jump on this.
I have the same question.

We want have some public information with a link where a unknown user can access a course.
This courses save some data to the user so it must be a moodle user.

I can create a user by webservices and enroll it to the course.

But how can I login this user without showing the login screen?

Can I use a one-time-login-link?
Or pass username and password via get to the login link?

Thanks

Stefan