Can change login logic?

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( ).
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?