Logging in to an SPA , preauthenticated by another application

Hi All, wondering if there is an out of the box solution for this.

We have an SPA that we host that is secured using Auth0. Users are added to an Auth0 database and can login using the universal login screen, a username and a password, they have to be created in the Auth0 database first.

Separately, we have another legacy application that is hosted in a different way and is not using Auth0 for user logins. It maintains its own database of users, and these users are not set up in Auth0. I would like to be able to give access to these users to the Auth0 managed service somehow. I am thinking there might be a way of using an M2M token for this application to generate a token to give to the user, who once redirected to the service, would not need an additional login.

Does anyone know if such a thing is possible?