【发布时间】:2015-06-18 00:24:41
【问题描述】:
我正在与 HWIOAuthBundle 作斗争。 我正在尝试使它与 twitter Oauth 一起使用,但我不确定我是否走在正确的道路上,如果这个问题看起来微不足道,我从现在开始道歉。
我正在遵循文档中报告的一些说明。
我有这个配置:
config.yml
hwi_oauth:
firewall_name: secured_area;
resource_owners:
twitter:
type: twitter
client_id: <consumer_key>
client_secret: <consumer-secret>
routing.yml
hwi_oauth_redirect:
resource: "@HWIOAuthBundle/Resources/config/routing/redirect.xml"
prefix: /connect
hwi_oauth_login:
resource: "@HWIOAuthBundle/Resources/config/routing/login.xml"
prefix: /login
security.yml
firewalls:
...
secured_area:
anonymous: ~
oauth:
resource_owners:
twitter: "/login/check-twitter"
login_path: /login
use_forward: false
failure_path: /login
oauth_user_provider:
service: hwi_oauth.user.provider
access_control:
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
在 oauth_user_provider 中,我知道我可以使用文档页面 https://github.com/hwi/HWIOAuthBundle/blob/master/Resources/doc/3-configuring_the_security_layer.md 中报告的三个默认实现之一
如果我尝试访问此配置所涵盖的页面,我会收到:
CheckExceptionOnInvalidReferenceBehaviorPass.php 第 58 行中的 ServiceNotFoundException:服务“hwi_oauth.security.oauth_utils”依赖于不存在的服务“hwi_oauth.resource_ownermap.secured_area;”。
请问有人可以告诉我这个错误是由什么引起的吗?我在 oauth_user_provider 中指定的服务是否不好,并且我误解了有关实现 OAuthAwareUserProviderInterface 的服务的 3 个默认实现的文档?
【问题讨论】:
标签: php symfony hwioauthbundle