HybridAuth is an open source PHP library that provides a consistent API for social APIs and identity providers.
If you were looking for a relatively easy way to provide a ‘Sign in With Facebook/Twitter/Google’ feature to your site, this is a decent place to start. The source code is available at https://github.com/hybridauth/hybridauth.