<div dir="ltr"><div>I&#39;ve been trying to work with the Social Providers feature of Keycloak, but I&#39;ve had some problems.</div><div><br></div><div>First of all I&#39;m using the beta-2 version, and I created Facebook and Google links to applications I have there and it worked fine.</div>
<div><br></div><div>If I create a new user logging in with Facebook it works</div><div>If I create a new user logging in with Google it works aswell.</div><div><br></div><div>When I try linking things, that&#39;s where things go wrong.</div>
<div><br></div><div>I have created a new Keycloak user, and accessed:</div><div><br></div><div><b><a href="http://localhost:8080/auth/realms/myrealm/account">http://localhost:8080/auth/realms/myrealm/account</a></b></div>
<div><br></div><div>and on that URL I associated my Google and Facebook accounts, when I do it like that, it all works fine, but when I tried to see if it worked automatically it all went south.</div><div><br></div><div>I deleted the social links from this account, and then tried to login to a keycloak secured application via Facebook, and the e-mail of my Facebook account is the same of the keycloak accunt, which led to an exception</div>
<div><br></div><div><i>org.keycloak.models.ModelDuplicateException: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: ERROR: duplicate key value violates unique constraint &quot;userentity_realm_email_key&quot;</i></div>
<div><br></div><div>The same happens if I have no account at all, and create one with Facebook, then try logging in with Google.</div><div><br></div><div>Is there something I&#39;m missing, or is this flow still being worked on?</div>
<div><br></div><div>I have read this wiki, and I think it&#39;s the item 5 that isn&#39;t working correctly</div><div><br></div><div><a href="https://github.com/keycloak/keycloak/wiki/Registration-Authentication-with-social-providers-and-linking-of-social-accounts">https://github.com/keycloak/keycloak/wiki/Registration-Authentication-with-social-providers-and-linking-of-social-accounts</a></div>
<div><br clear="all"><div><br></div>-- <br><div dir="ltr"><font face="Times New Roman">Rodrigo Sasaki</font><div></div></div>
</div></div>