Note that there are some explanatory texts on larger screens.

plurals
  1. POService not triggered : The controller must return a response (null given)
    text
    copied!<p>Hi everyone and huge thanks for the help, I am trying to get FOSFacebook work, but it seems to be impossible until now. I tried a lot of configuration, and a lot of fix but nothing worked for me.</p> <p>Here is my configuration :</p> <p><b>security.yml</b></p> <pre><code>chain_provider: chain: providers: [fos_userbundle, fos_facebook_provider] fos_userbundle: id: fos_user.user_provider.username fos_facebook_provider: id: fos.facebook.custom_provider firewalls: dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false main: pattern: ^/ form_login: login_path: fos_user_security_login check_path: fos_user_security_check provider: fos_userbundle csrf_provider: form.csrf_provider logout: true anonymous: true public: pattern: ^/ fos_facebook: app_url: "http://apps.facebook.com/myApp/" server_url: "http://www.mywebsite.com" login_path: /facebook/login check_path: /facebook/check default_target_path: / provider: fos_facebook_provider anonymous: false logout: handlers: ["fos_facebook.logout_handler"] </code></pre> <p><b>config.yml</b></p> <pre><code>fos.facebook.custom_provider: class: Bundles\UserBundle\Security\User\Provider\FacebookProvider arguments: facebook: "@fos_facebook.api" userManager: "@fos_user.user_manager" validator: "@validator" container: "@service_container" fos_facebook: file: %kernel.root_dir%/../vendor/facebook/php-sdk/src/base_facebook.php alias: facebook app_id: myid secret: mysecret cookie: true permissions: [email] </code></pre> <p><b>routing.yml</b></p> <pre><code> _security_check: pattern: /facebook/check _security_logout: pattern: /logout </code></pre> <p><b>Twig Template</b></p> <pre><code>&lt;script type="text/javascript"&gt; function goLogIn(){ window.location.href = "{{ path('_security_check') }}"; } function onFbInit() { if (typeof(FB) != 'undefined' &amp;&amp; FB != null ) { FB.Event.subscribe('auth.statusChange', function(response) { if (response.session || response.authResponse) { setTimeout(goLogIn, 500); } else { window.location.href = "{{ path('_security_logout') }}"; } }); } } &lt;/script&gt; {{ facebook_initialize({'xfbml': true, 'fbAsyncInit': 'onFbInit();'}) }} </code></pre> <p><b>UserController.php</b></p> <pre><code> * @Route("/facebook/check") */ public function loginCheckFacebookAction(){ } </code></pre> <p>And the provider and the modification to User class (as in the <a href="https://github.com/FriendsOfSymfony/FOSFacebookBundle/blob/master/README.md" rel="nofollow">Readme</a>).</p> <p>But the problem is that the service not seemed to be called. Indeed, the method in the UserController must be a dummy method, and it is not like that here. The method is called and of course I get this error : </p> <p><em>LogicException: The controller must return a response (null given). Did you forget to add a return statement somewhere in your controller? (uncaught exception).</em></p> <p>What is my error here ?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload