没有名为';的资源所有者;谷歌';(HWIOAuthBundle和FOSUserBundle集成)


No resource owner with name 'google' (HWIOAuthBundle & FOSUserBundle integration)

我安装了HWIOAuthBundle,并按照这里所说的做了一切:https://gist.github.com/danvbe/4476697

但当我尝试转到此处时,会出现以下错误:"/login/google"

没有名为"谷歌"的资源所有者。

我和其他API有同样的错误:yahoo,linkedin,windows_live

我不知道为什么,因为我已经完成了很好的安全。yml:

jms_security_extra:
secure_all_services: false
expressions: true
security:
    encoders:
        Symfony'Component'Security'Core'User'User: plaintext
        FOS'UserBundle'Model'UserInterface: sha512
role_hierarchy:
    ROLE_ADMIN:       ROLE_USER
    ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
providers:
        fos_userbundle:
            id: fos_user.user_provider.username_email
firewalls:
    dev:
        pattern:  ^/(_(profiler|wdt)|css|images|js)/
        security: false
    main:
        pattern: ^/                         
        form_login:                            
            provider: fos_userbundle        
            remember_me: true                  
            csrf_provider: form.csrf_provider
            login_path: /login
            check_path: /login_check
        remember_me:
            key: %secret%                      
        anonymous: true
        logout: true                                         
        oauth:
            resource_owners:
                yahoo:              "/login/check-yahoo"
                google:             "/login/check-google"
                windows_live:       "/login/check-windows_live"
                linkedin:           "/login/check-linkedin"
            login_path:        /login
            failure_path:      /login
            oauth_user_provider:
                service: my_user_provider
        logout:
            path: /logout
            target: /
    login:
        pattern:  ^/login$
        security: false
        remember_me:
            key: "%secret%"
            lifetime: 31536000 # 365 days in seconds
            path: /
            domain: ~ # Defaults to the current domain from $_SERVER
access_control:
    - { path: ^/$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/login$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/register, roles: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/resetting, roles: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/profile, roles: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/(search|contact|myprofile), roles: ROLE_USER }

还有config.yml:

imports:
- { resource: parameters.yml }
- { resource: security.yml }
- { resource: "@MyprojectUserBundle/Resources/config/services.yml" }
#[..]
fos_user:
    db_driver: orm
    firewall_name: main
    user_class: Uvaluo'UserBundle'Entity'User
    registration:
        form:
            type: uvaluo_user_registration
        confirmation:
            enabled: true
            template: FOSUserBundle:Registration:email.txt.twig
hwi_oauth:
    connect:
        account_connector: my_user_provider
    firewall_name: main
    fosub:
        username_iterations: 30
        properties:
            yahoo: yahoo_id
            google: google_id
            windows_live: windows_live_id
            linkedin: linkedin_id
    resource_owners:
        any_name:
            type:                yahoo
            client_id:           X
            client_secret:       X
        any_name:
            type:                google
            client_id:           X
            client_secret:       X
            scope:               "https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile"    
        any_name:
            type:                windows_live
            client_id:           X
            client_secret:       X
        any_name:
            type:                linkedin
            client_id:           X
            client_secret:       X
            scope:               r_basicprofile

我已经设置了所有资源所有者,所以我不知道为什么会出现这个错误。

我发现了错误,我忘记用谷歌、雅虎、linkedin、windows_live 替换"any_name"

对我来说,它在安全性中被错误地配置了resource_owners。yml