I want to integrate my own API, create a new custom action

I want to integrate my own API, create a new custom action, and use the access token that is obtained from it throughout the application flow. Using my own API, clicking the login button does not log me into the application.