Rights and REST Api

Hi!

I am currently using Rights for user management, but I want to develop an REST API.

I followed this suggestions link, but now I want to use authentication.

How can I do this? I’m sendind username and password on the Header, but, what’s the method Rights uses to authenticate a user?

I just managed one alternative:

I created a UserLogin object with the header credentials and called validate. Hope this is the right way. Its working.