7
votes

Trying to connect facebook using HWI/OAuthBundle, following all of the steps that say in HWI/OauthBundle Doc, but it return error

There is no user provider for user "HWI\Bundle\OAuthBundle\Security\Core\User\OAuthUser"

Does anyone can explain for me why this happen and how to fix this problem?

3

3 Answers

18
votes

Add to security.yml

providers:                             
    hwi:                               
        id: hwi_oauth.user.provider    

or your custom user provider service

3
votes

Above is almost correct. It should be added to security.yml not services.yml. See below for example in context.

providers:
    in_memory:
        memory:
            users:
                admin: { password: somesecretpassowrd, roles: 'ROLE_ADMIN' }
    hwi:                               
        id: hwi_oauth.user.provider
-1
votes

This exception appears when services.yml is put below security.yml in config.yml. Apparently, hwi_oauth service has to be defined before it's going to be used in security providers. So the correct sequence of resources in config.yml is supposed to be:

 
         - { resource: services.yml }
         - { resource: security.yml }