by Mayank Tyagi.
Moodle uses api "https://mymoodle.site.com/login/token.php?username=USER\&password=PASSWORD\&service=moodle_mobile_app" for user authentication for its mobile application itself. This api will provide you token associated with user only if the user entered correct crendentials. By doing so you can verify whether user entered correct credentials or not.