Login using API

Hello All:

new to this community and evaluating Okta. Right now, we want to provide a Single sign on experience to our users by connecting two apps. however, one app is a legacy. We will not be able to migrate the users immediately. So our requirements is that when a users logs into the legacy app, it uses its native authentication method, but fires API authentication to OKTA to automatically log in the user into the New App. This way, the experience is seamless. Later the plan is to migrate all the users from Legacy app to Okta.
please help me understand it this is even a possible scenario and if there is a solution. I am totally new to concept of SSO and its implementation.

Milind.

This should work:

https://developer.okta.com/docs/api/resources/authn/#primary-authentication