首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >安装HWIOAuthBundle?

安装HWIOAuthBundle?
EN

Stack Overflow用户
提问于 2013-09-11 02:44:41
回答 3查看 2.1K关注 0票数 2

我尝试了10次来找出如何安装HWIOAuthBundle,但是没有足够的文档,我安装了捆绑包,我完全按照Git中的文档操作,但它显示了这个错误:

代码语言:javascript
复制
InvalidConfigurationException: Unrecognized options "anonymous" under "security.firewalls.secured_area.oauth"

不知何故,我不明白A)部分的意思:“拥有一个实现的用户提供者”。我应该做什么?或者我在哪里可以找到简单的文档

代码语言:javascript
复制
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)

我应该在这里做什么?

EN

回答 3

Stack Overflow用户

发布于 2014-06-05 05:19:42

您应该替换/注释掉服务的行:

代码语言:javascript
复制
oauth_user_provider:
    service: my.oauth_aware.user_provider.service

然后替换为:

代码语言:javascript
复制
oauth_user_provider:
    oauth: ~

来源:https://github.com/hwi/HWIOAuthBundle/issues/72

更进一步:

票数 1
EN

Stack Overflow用户

发布于 2013-09-12 19:28:54

啊,看起来像是文档中的打字错误,你能把anonymous的4个空格改小一点吗?

代码语言:javascript
复制
# 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
票数 0
EN

Stack Overflow用户

发布于 2014-12-20 19:37:35

解决这个问题的简单方法是像这样定义一个服务:

在security.yml中,保留以下内容:

代码语言:javascript
复制
oauth_user_provider:
                service: my.oauth_aware.user_provider.service

在services.yml中放入以下内容:

代码语言:javascript
复制
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"]

就是这样!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18726595

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档