by Martin Mastny.
Hello Pablo,
I was also experiencing this kind of issue. My problem was, that my plugin was just for teachers, so when somebody is assigned as a teacher I also have to assign a web service user role to him. I solved this by creating a simple DATABASE TRIGGER that inserts another role to mdl_role_assignments.
You can generate a token for user on the fly :
http://docs.moodle.org/dev/Creating_a_web_service_client#How_to_get_a_user_token
Hope this helps
Martin