Log in a user via the API

I have already suggested something similar.