I'm trying to add HWIOAuthBundle in my existing project, and i'm stuck with this error message :
[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException] Unable to replace alias "hwi_oauth.user.provider.fosub_bridge" with "hwi_oaut
[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException] The service definition "hwi_oauth.user.provider.fosub_bridge" does not exist.
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.
My configuration is :
#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 }
Any idea where i'm wrong ?
Thanks for your help,