I\'m trying to setup FOSFacebookBundle and FOSUserBundle, so users can login with registered accounts or facebook accounts.
Here relevant codes:
config.yml:
Here the solution:
in routing.yml
_security_check:
pattern: /loginFb
in security.yml:
fos_facebook:
check_path: /loginFb
in default controller:
/**
* Dummy controller.
*
* @Route("/loginFb")
* @Template
*
*
* */
public function loginFbAction() {
}
https://github.com/FriendsOfSymfony/FOSFacebookBundle/tree/2.0#include-the-login-button-in-your-templates says:
Note that we wait 500ms before redirecting to let the browser dealing with the Facebook cookie. You can avoid this step but you might get this error message: "The Facebook user could not be retrieved from the session."