In my Symfony 2.6 website I have a login form that works. I'm now working on a registration/authentication based on Facebook SDK.
On the Facebook side, I have no problems, the user local account is created and the login works.
But, when I programmatically authenticate a Facebook-registered user (just after its first registration), Symfony says in the debug toolbar that the user is logged, but not authenticated:
If the user logouts, then login again (but not using the Symfony form, but still my system), it is full-authenticated:
Here the code I use to authenticate the Facebook user:
$token = new UsernamePasswordToken($user, $user->getPassword(), 'main', $user->getRoles());
$this->get('security.token_storage')->setToken($token);
This code is used to authenticate Facebook users, at their registration and also on login. What are the consequences if the user is not fully authenticated? And how to fully-authenticate the user at the first registration?
Here my authentication method on Pastebin : http://pastebin.com/d5T2umGx