1

i am using HWIOAuthBundle to integrate Facebook oAuth and when i update my schema i am getting following error

  [Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]  
  Unrecognized options "resource_owners" under "security.firewalls.oauth"   

here is my security.yml and i really dont know what is this error

jms_security_extra:
    secure_all_services: false
    expressions: true

security:

    providers:
        fos_userbundle:
            id: fos_user.user_provider.username
       # administrators:
        #    entity: { class: NotificaHomeBundle:TbNotificaUser }

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

   firewalls:
        main:
            pattern: ^/
            form_login:
                provider: fos_userbundle
                csrf_provider: form.csrf_provider
                login_path: /login
                check_path: /login_check
            logout: true
            anonymous: true

        oauth:
         resource_owners:
          facebook: "/login/check-facebook"

        oauth_user_provider:
                    #this is my custom user provider, created from FOSUBUserProvider - will manage the 
                    #automatic user registration on your site, with data from the provider (facebook. google, etc.)
                    service: my_user_provider

        oauth_token:
            pattern:    ^/oauth/v2/token
            security:   false


        oauth_authorize:
            pattern:    ^/oauth/v2/auth
            form_login:
                 provider: fos_userbundle
                 check_path: /oauth/v2/auth/login_check
                 login_path: /oauth/v2/auth/login
            anonymous: true
            # Add your favorite authentication process here

        api:
            pattern:    ^/api
            fos_oauth:  true
            stateless:  true
            anonymous: true # can be omitted as its default value

        # admin_area:
           # pattern:    ^/xadmin
           # http_basic: ~

    access_control:
        - { path: ^/login, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/admin/, role: ROLE_ADMIN }
        - { path: ^/notifica/login, role: IS_AUTHENTICATED_ANONYMOUSLY }
       # - { path: ^/xadmin/, role: ROLE_ADMIN }
        - { path: ^/api, roles: [ IS_AUTHENTICATED_ANONYMOUSLY ] }

    role_hierarchy:
        ROLE_ADMIN:       ROLE_USER
        ROLE_SUPER_ADMIN: ROLE_ADMIN
Hunt
  • 8,215
  • 28
  • 116
  • 256

1 Answers1

0

Your identation is wrong. YAML files are based on identation.

firewalls:
    main:
        pattern: ^/
        form_login:
            provider: fos_userbundle
            csrf_provider: form.csrf_provider
            login_path: /login
            check_path: /login_check
        oauth:
            resource_owners:
                facebook:           "/login/check-facebook"
                google:             "/login/check-google"
            login_path:        /login
            failure_path:      /login

            oauth_user_provider:
                #this is my custom user provider, created from FOSUBUserProvider - will manage the 
                #automatic user registration on your site, with data from the provider (facebook. google, etc.)
                service: my_user_provider
Udan
  • 5,429
  • 2
  • 28
  • 34
  • if i use this code then i am getting `Unrecognized options "resource_owners, login_path, failure_path" under "sec urity.firewalls.oauth"` – Hunt Oct 23 '13 at 17:44