1

我正在使用HWIOAuthBundle集成FacebookoAuth 并且当我更新我的架构时出现以下错误

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

这是我的security.yml,我真的不知道这是什么错误

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
4

1 回答 1

0

你的认识是错误的。YAML 文件基于标识。

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
于 2013-10-23T17:18:39.003 回答