I'm novice of Moodle developing. I want to programmatically login a certain user according to the user's related shared-secret-matching. I read the Authentication_plugins doc, find a function: user_login($username, $password). But this function requires the password parameter. I don't need it, I just want only the username parameter. Then how can I make it? By generating a user cookie?
General developer forum
How to programmatically login a user?
If you're implementing your own authentication plugin, then it is up to you what you do with the parameters - if you want to completely ignore the 'password' param and only use the 'username' param, then that is fine. As long as you do the necessary checks and then return 'true' if the user has been authenticated.
Thank you for your tip! A further question please: in which function I will return TRUE?