我试图在我现有的项目中添加HWIOAuthBundle,并且我遇到了这个错误消息:
[Symfony的\元器件\ DependencyInjection \异常\ InvalidArgumentException] 无法替换别名" hwi_oauth.user.provider.fosub_bridge"同 " hwi_oaut
[Symfony的\元器件\ DependencyInjection \异常\ InvalidArgumentException] 服务定义" hwi_oauth.user.provider.fosub_bridge"才不是 存在。
PS C:\wamp\www\test> php app/console debug:container hwi_oauth.user.provider.fosub_bridge
[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
Unable to replace alias "hwi_oauth.user.provider.fosub_bridge" with "hwi_oauth.user.provider.entity.main".
[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
The service definition "hwi_oauth.user.provider.fosub_bridge" does not exist.
我的配置是:
#config.yml
fos_user:
db_driver: orm
firewall_name: main
user_class: ScopIt\UserBundle\Entity\User
hwi_oauth:
firewall_name: main
resource_owners:
any_name:
type: azure
client_id: <client_id>
client_secret: <client_secret>
options:
resource: https://graph.windows.net
application: common
#Security.yml
security:
encoders:
Symfony\Component\Security\Core\User\User: plaintext
FOS\UserBundle\Model\UserInterface: sha512
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
providers:
fos_userbundle:
id: fos_user.user_provider.username
firewalls:
main:
pattern: ^/
form_login:
provider: fos_userbundle
csrf_provider: form.csrf_provider
logout: true
switch_user: { role: ROLE_ADMIN, parameter: _want_to_be_this_user }
anonymous: true
form_login:
# submit the login form here
check_path: /login_check
# the user is redirected here when they need to log in
login_path: /login
# if true, forward the user to the login form instead of redirecting
use_forward: false
# login success redirecting options (read further below)
always_use_default_target_path: true
default_target_path: /
use_referer: false
oauth:
resource_owners:
azure: "/login/check-azure"
login_path: /login
use_forward: false
failure_path: /login
oauth_user_provider:
service: hwi_oauth.user.provider.fosub_bridge
access_control:
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/, role: ROLE_ADMIN }
知道我哪里错了吗?
感谢您的帮助,