Create a .php file and autoload the vendor classes:
require_once 'vendor/autoload.php'; // Path may vary
Next, import and new up the classes:
$credentials = include __DIR__.'/path/to/providers.php';
$providerFactory = new ProviderFactory($credentials);
$auth = new Authenticator($providerFactory);
Now you have $auth to work with. Jump to #usage to see how easy it is... ;)
Laravel 5 Implementation
Add the ServiceProvider to the providers array in config/app.php:
When you run $auth->request('provider') you will first be redirected to the provider. You will need to grant or deny access to your personal information and then you will be redirected back to the page where you came from.
IMPORTANT: You need to set your page as a valid callback URL in your App!
Also note that this script will always append ?run=1 to the URL when you are redirected back. Depending on the provider, they are touchy about this. At least for Google this is very important, so make sure you include it in the callback URL in your App settings if needed!
Check the response...
Now you can handle the $details that were returned by the provider:
When you get redirected back to your site after a successful request, you will notice that there is a token in the URL. This token can't be used twice, so if you would refresh the page an exception would be thrown...
Therefor, it might be wise to redirect your users somewhere after you're done.