0

I'm trying to use FOSFacebookBundle in Symfony 2.3 as it says in https://github.com/FriendsOfSymfony/FOSFacebookBundle/blob/master/Resources/doc/2-integration-with-fosuserbundle.md but I always get the error: Can't solve Fatal error: Class My\UserBundle\Security\User\Provider\FacebookProvider' not found in app/cache/de_/ap_DevDebugProjectContainer.php

I have tryed multiple things, but can't find what it is wrong.

My code sample-

Security.yml

security:
encoders:
    FOS\UserBundle\Model\UserInterface: sha512

role_hierarchy:
    ROLE_ADMIN:       ROLE_USER
    ROLE_SUPER_ADMIN: ROLE_ADMIN

providers:
    chain_provider:
      chain:
        providers: [fos_userbundle, my_fos_facebook_provider]
    fos_userbundle:
      id: fos_user.user_provider.username
    my_fos_facebook_provider:
      id: my.facebook.user

firewalls:
    main:
        pattern: ^/
        form_login:
            provider: fos_userbundle
            csrf_provider: form.csrf_provider
        logout:       true
        anonymous:    true
    public:
        pattern:   ^/.*
        fos_facebook:
            app_url: "xxxxxx"
            server_url: "xxxxxx"
            login_path: /login
            check_path: /login_fb_check
            default_target_path: /
        anonymous: true
access_control:
    - { path: ^/secured/.*, role: [IS_AUTHENTICATED_FULLY] }
    - { path: ^/.*, role: [IS_AUTHENTICATED_ANONYMOUSLY] }
    - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/admin/, role: ROLE_ADMIN }

config.yml

services:
    my.facebook.user:
        class: My\UserBundle\Security\User\Provider\FacebookProvider
        arguments:
            facebook: "@fos_facebook.api"
            userManager: "@fos_user.user_manager"
            validator: "@validator"

parameters.yml

facebook.app_id: xxxxxxx
facebook.app_secret: xxxxxxxxx
Kunwar Siddharth Singh
  • 1,676
  • 6
  • 33
  • 66
  • 1
    delete cache/dev and try again. If it still does not work then make sure you actually have a file called FacebookProvider in the correct location. This is not a facebook issue. The service layer simply cannot find the file. Of course you need to make sure UserBundle is on AppKernel.php. – Cerad Aug 21 '13 at 14:49
  • @Cerad thanks for help, May be location problem because when i again complete all process this is working. – Kunwar Siddharth Singh Aug 22 '13 at 06:56

0 Answers0