You might be able to get away with using some REST services. Another option is to use the API and create a connection to that other database during your authentication process. Another option could be to create a web service on the site you want to authenticate against and expose it publically, then on your other site, call that function which will privately call the API to authenticate the user with the passed in username and password.