FOSFacebookBundle and FOSUserBundle

前端 未结 2 1152
粉色の甜心
粉色の甜心 2021-02-09 13:43

I\'m trying to setup FOSFacebookBundle and FOSUserBundle, so users can login with registered accounts or facebook accounts.

Here relevant codes:

config.yml:

相关标签:
2条回答
  • 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() {
    }
    
    0 讨论(0)
  • 2021-02-09 14:39

    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."

    0 讨论(0)
提交回复
热议问题