7

尝试使用HWI/OauthBundle DocHWI/OAuthBundle中所说的所有步骤连接 facebook ,但它返回错误

用户“HWI\Bundle\OAuthBundle\Security\Core\User\OAuthUser”没有用户提供程序

有谁可以为我解释为什么会发生这种情况以及如何解决这个问题?

4

3 回答 3

19

添加到 security.yml

providers:                             
    hwi:                               
        id: hwi_oauth.user.provider    

或您的自定义用户提供商服务

于 2014-04-04T11:51:03.200 回答
3

以上几乎是正确的。它应该被添加到 security.yml 而不是 services.yml。参见下面的例子。

providers:
    in_memory:
        memory:
            users:
                admin: { password: somesecretpassowrd, roles: 'ROLE_ADMIN' }
    hwi:                               
        id: hwi_oauth.user.provider
于 2014-06-11T19:55:50.787 回答
-1

services.yml当放在下面时会security.yml出现此异常config.yml。显然,必须先定义 hwi_oauth 服务,然后才能在安全提供商中使用它。所以正确的资源顺序config.yml应该是:

 
         - {资源:services.yml}
         - {资源:security.yml}
    

于 2015-10-22T09:01:12.973 回答