ServiceNotFoundException:HWIOAuthBundle + Salesforce 资源所有者
ServiceNotFoundException: HWIOAuthBundle + Salesforce resource owner
我正在尝试安装并配置 HWIOAuthBundle 捆绑包,但我遇到了一些问题。这就是我所做的:
1) 在 AppKernel.php
:
处启用捆绑包
new HWI\Bundle\OAuthBundle\HWIOAuthBundle(),
2) 将此行添加到 config.yml
:
imports:
- { resource: parameters.yml }
- { resource: security.yml }
- { resource: sonata.yml }
- { resource: hwi.yml }
3) 在 hwi.yml
文件中写入以下内容:
hwi_oauth:
firewall_name: admin_area
resource_owners:
salesforce:
type: salesforce
client_id: <cliend_id>
client_secret: <client_secret>
4) 在routing.yml
:
开头添加路由
#FOSUserBundle
fos_user:
resource: "@FOSUserBundle/Resources/config/routing/all.xml"
#HWIOAuthBundle
hwi_oauth_redirect:
resource: "@HWIOAuthBundle/Resources/config/routing/redirect.xml"
prefix: /connect
hwi_oauth_login:
resource: "@HWIOAuthBundle/Resources/config/routing/login.xml"
prefix: /login
#SonataAdmin
admin:
resource: '@SonataAdminBundle/Resources/config/routing/sonata_admin.xml'
prefix: /admin
_sonata_admin:
resource: .
type: sonata_admin
prefix: /admin
当我在浏览器上调用时:http://applocal.dev/app_dev.php
我得到了这个错误:
ServiceNotFoundException in
CheckExceptionOnInvalidReferenceBehaviorPass.php line 58: The service
"hwi_oauth.security.oauth_utils" has a dependency on a non-existent
service "hwi_oauth.resource_ownermap.admin_area".
我在这里缺少什么?为什么会出现这个错误?
您似乎没有配置 oauth 防火墙
请检查您在 app/config/security.yml 中是否有像这样的东西:
security:
firewalls:
admin_area:
anonymous: ~
oauth:
resource_owners:
facebook: "/login/check-facebook"
google: "/login/check-google"
my_custom_provider: "/login/check-custom"
my_github: "/login/check-github"
login_path: /login
use_forward: false
failure_path: /login
oauth_user_provider:
service: my.oauth_aware.user_provider.service
access_control:
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
我正在尝试安装并配置 HWIOAuthBundle 捆绑包,但我遇到了一些问题。这就是我所做的:
1) 在 AppKernel.php
:
new HWI\Bundle\OAuthBundle\HWIOAuthBundle(),
2) 将此行添加到 config.yml
:
imports:
- { resource: parameters.yml }
- { resource: security.yml }
- { resource: sonata.yml }
- { resource: hwi.yml }
3) 在 hwi.yml
文件中写入以下内容:
hwi_oauth:
firewall_name: admin_area
resource_owners:
salesforce:
type: salesforce
client_id: <cliend_id>
client_secret: <client_secret>
4) 在routing.yml
:
#FOSUserBundle
fos_user:
resource: "@FOSUserBundle/Resources/config/routing/all.xml"
#HWIOAuthBundle
hwi_oauth_redirect:
resource: "@HWIOAuthBundle/Resources/config/routing/redirect.xml"
prefix: /connect
hwi_oauth_login:
resource: "@HWIOAuthBundle/Resources/config/routing/login.xml"
prefix: /login
#SonataAdmin
admin:
resource: '@SonataAdminBundle/Resources/config/routing/sonata_admin.xml'
prefix: /admin
_sonata_admin:
resource: .
type: sonata_admin
prefix: /admin
当我在浏览器上调用时:http://applocal.dev/app_dev.php
我得到了这个错误:
ServiceNotFoundException in CheckExceptionOnInvalidReferenceBehaviorPass.php line 58: The service "hwi_oauth.security.oauth_utils" has a dependency on a non-existent service "hwi_oauth.resource_ownermap.admin_area".
我在这里缺少什么?为什么会出现这个错误?
您似乎没有配置 oauth 防火墙
请检查您在 app/config/security.yml 中是否有像这样的东西:
security:
firewalls:
admin_area:
anonymous: ~
oauth:
resource_owners:
facebook: "/login/check-facebook"
google: "/login/check-google"
my_custom_provider: "/login/check-custom"
my_github: "/login/check-github"
login_path: /login
use_forward: false
failure_path: /login
oauth_user_provider:
service: my.oauth_aware.user_provider.service
access_control:
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }