我尝试了10次来找出如何安装HWIOAuthBundle,但是没有足够的文档,我安装了捆绑包,我完全按照Git中的文档操作,但它显示了这个错误:
InvalidConfigurationException: Unrecognized options "anonymous" under "security.firewalls.secured_area.oauth"不知何故,我不明白A)部分的意思:“拥有一个实现的用户提供者”。我应该做什么?或者我在哪里可以找到简单的文档
A) Have a user provider that implements OAuthAwareUserProviderInterface
The bundle needs a service that is able to load users based on the user response of the oauth endpoint. If you have a custom service it should implement the interface: HWI\Bundle\OAuthBundle\Security\Core\User\OAuthAwareUserProviderInterface.
The HWIOAuthBundle also ships with three default implementations:
OAuthUserProvider (service name: hwi_oauth.user.provider) - doesn't persist users
EntityUserProvider (service name: hwi_oauth.user.provider.entity) - loads users from a database
FOSUserBundle integration (service name: hwi_oauth.user.provider.fosub_bridge). Checkout the documentation for integrating HWIOAuthBundle with FOSUserBundle for more information: (todo)我应该在这里做什么?
发布于 2014-06-05 05:19:42
您应该替换/注释掉服务的行:
oauth_user_provider:
service: my.oauth_aware.user_provider.service然后替换为:
oauth_user_provider:
oauth: ~来源:https://github.com/hwi/HWIOAuthBundle/issues/72
更进一步:
发布于 2013-09-12 19:28:54
啊,看起来像是文档中的打字错误,你能把anonymous的4个空格改小一点吗?
# app/config/security.yml
security:
firewalls:
secured_area:
anonymous: ~
oauth:
resource_owners:
facebook: "/login/check-facebook"
login_path: /login
failure_path: /login
oauth_user_provider:
service: my.oauth_aware.user_provider.service发布于 2014-12-20 19:37:35
解决这个问题的简单方法是像这样定义一个服务:
在security.yml中,保留以下内容:
oauth_user_provider:
service: my.oauth_aware.user_provider.service在services.yml中放入以下内容:
services:
my.oauth_aware.user_provider.service:
class: HWI\Bundle\OAuthBundle\Security\Core\User\FOSUBUserProvider
arguments:
userManager: "@fos_user.user_manager"
properties: ["pass properties as array"]就是这样!
https://stackoverflow.com/questions/18726595
复制相似问题