Authentication in external application using Moodle.

Authentication in external application using Moodle.

by doodle moodle -
Number of replies: 1

Hi All,

Moodle version 3.2

I have a desktop based application which is integrated with Moodle i.e. it uses users and their credentials created in Moodle.


Correct me if I m wrong. Password in Moodle is salted and then stored in database. And, this encryption is irreversible. So, how do I authenticate the users on my external application?


I assume, I'll have to redirect users to moodle's authentication API and then redirect them back to my application after successful or unsuccessful attempt.


Please help on how to go about it.

Thank you.

Average of ratings: -
In reply to doodle moodle

Re: Authentication in external application using Moodle.

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Assuming it's not something completely custom then it might help to tell us what your application is?

Yes - you really want to be using Moodle's authentication "inside" Moodle. There are several ways you *could* do this. Here's one suggestion - use Moodle's web service authentication. You just need to set up a "dummy" service (or just enable Moodle mobile) and allow users to create tokens. Authentication then becomes as simple as sending a URL to Moodle's login/token.php with the username and password. If you get a token back then they must be a valid user. 

See... https://docs.moodle.org/dev/Creating_a_web_service_client#How_to_get_a_user_token