In my project I'm using Twitter as user data provider.
I found this code: https://gist.github.com/adeslade/1148079 and I'm using it with this custom middleware
<?php
use Symfony\Component\HttpFoundation\RedirectResponse;
$app['controllers']
-> before(function ($request) use ($app) {
$path = substr($request -> getRequestUri(), strlen($request -> getBasePath()));
// I put all twitter data in the session under the key "twitter"
if (!$app['session'] -> has('twitter'))
if (!preg_match("#^(/|/login(/.*)?)$#", $path))
return new RedirectResponse('/');
});
This works fine, but my hope is to use the preinstalled tool SecurityServiceProvider like GromNaN/FacebookServiceProvider and sensiolabs/Silex-Connect without lose days creating it.
Is it recommended to follow my intention or could it become a second big project?