Login to multiple php accounts with same credentials

I’m trying to launch multiple sites with different functionalities but my market is the same, so I would like for a client to register in one site but use the same credentials to login to another. All sites are in php. Something like “Login with Facebook” but instead of Facebook it says my main site. How can I do this?

I’ve been researching the REST API but I can’t find conclusive answers if this would work