简体   繁体   中英

ServiceNotFoundException: The service “my.facebook.user” has a dependency on a non-existent service “fos_user.user_manager”

I'm using the fosFacebookBundle for symfony2. I followed the instructions from the installation guide but now I don't know what I must change in the security section for the userManager:

services:
my.facebook.user:
    class: Acme\MyBundle\Security\User\Provider\FacebookProvider
    arguments:
        facebook: "@fos_facebook.api"
        userManager: "@fos_user.user_manager"
        validator: "@validator"
        container: "@service_container"

I think I must refer my UserRepository but I don't know the right syntax. Can anybody help me for this?

The second question is, how can I call the provider in my controller?

This is a bug in FOSFacebookBundle you have to use FOSUserBundle or use this for configuration and take this till your signin button after that code will be something like,

$facebook = $this->get('facebook');
$facebook_user = $facebook->getUser();
$userProfile = $facebook->api('/'.$facebook_user);
echo '<pre>'.print_r($userProfile,true).'</pre>';

This works for me, don't know work for you or not! but i will suggest you to try it once.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM