Can change login logic?

Hello.
Can I completely replace the authorization logic only through my resource (my API) ? After click “login” want send login and password to my REST API and get user data or error, then this response integration to your standard rocket logic( https://rocket.chat/docs/developer-guides/rest-api/authentication/login/ ).
Other words - I need user authentication in my side, where allready registration my command.
Is it possible to implement this? Where can I read about it?
Thank