I have tried all day to figure this out. So here goes.
I am using Symfony version 2.6.4
I originally had a login and signup form using friendsofsymfony/user-bundle": "2.0.*@dev
I have just added "hwi/oauth-bundle": "0.4.*@dev"
to allow for facebook signup/login.
The problem is that if I signup using my regular form and then attempt to login with facebook i get the following error. (I have changed some values for display purposes):
An exception occurred while executing 'INSERT INTO users (username, username_canonical, email, email_canonical, enabled, salt, password, last_login, locked, expired, expires_at, confirmation_token, password_requested_at, roles, credentials_expired, credentials_expire_at, facebook_id, facebook_access_token) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["10155387178995713", "10155387178995713", "someemail@hotmail.com", "someemail@hotmail.com", 1, "fgf90m9yxzc4ggkgwg8cgk0g4sk0ocg", "10155345628995713", null, 0, 0, null, null, null, "a:0:{}", 0, null, "10155387178995713", "CAALREhhNZBmEBANQjAMjlrAHZduiwOidsUyVwCI0hQkSj7W9imZC2xlL76jGH3MA10yUBkF2kSCpr9OdBbUSPoKkriZA2FdVlAhFsfXBNjBYiywzodiWYKGrcVMVsMVIVbk6XDUFVDtighTDYKuT9fZBm96VUSZBNSOE92RJMNwtAZCwBKrerAKGB11gNLNqDzNOfnBgih6TQDhacd9xSOC"]:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'someemail@hotmail.com' for key 'UNIQ_1483A5E9A0D96FBF'
If I signup using the regular form and then sign it also with the regular form I get the expected "Email is already in use"
if I sign up with facebook first and then login with facebook it works without issue.
The username/username_cononical when using the standard login form are set differently than when using the facebook signup. Currently the username under the normal login form generates a random string.
I dont care about the username either way. If it updates to the one given by facebook that would be great. I use email login only but keep the username entry in the database as it is standard with FOSUserBundle
I have followed the instructions here: https://gist.github.com/danvbe/4476697
I have also read this: http://m2mdas.github.io/blog/2013/11/21/integrate-hwioauthbundle-with-fosuserbundle/ but still no luck.
Any help would be really appreciated. Glad to post config info or code if requested.
thanks