I try to connect symfony 3 with HWIOAUTH Bundle and follow the tutorial https://gist.github.com/danvbe/4476697.
file config.yml
hwi_oauth:
connect:
account_connector: my_user_provider
firewall_names: [main]
fosub:
username_iterations: 30
properties:
google: googleId
facebook: facebookId
resource_owners:
facebook:
type: facebook
client_id: ***************
client_secret: ***************
scope: ""
google:
type: google
client_id: ***************
client_secret: ***************
scope: "https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile"
security.yml
main:
pattern: .*
context: user
form_login:
provider: fos_userbundle
login_path: /login
use_forward: false
check_path: /login_check
failure_path: null
default_target_path: list_items
always_use_default_target_path: true
oauth:
resource_owners:
facebook: "/connect/check-facebook"
google: "/connect/check-google"
login_path: /connect
failure_path: /connect
oauth_user_provider:
#this is my custom user provider, created from FOSUBUserProvider - will manage the
#automatic user registration on your site, with data from the provider (facebook. google, etc.)
service: my_user_provider
logout: true
anonymous: true
service.yml
my_user_provider:
class: AppBundle\Entity\FOSUBUserProvider
arguments: ['@fos_user.user_manager',{facebook: facebookId, google: googleId}]
Please help me fix this bug. I spent many times but can't fix it.
Update: Entity User
/**
* @var string
*
* @ORM\Column(name="facebookId", type="string", nullable=true)
*/
private $facebookId;