[keycloak-user] User federation in KC 5.0.0 duplicating user on some setups

Leandro Nunes leandronunes85 at gmail.com
Thu Mar 28 13:26:47 EDT 2019


Hi,

I'm trying KC 5.0.0 running on Java 1.8.0_191 with a newly created Realm
simply set up with a custom User Federation (this was tested running
"standalone.sh" against the H2 database). When I login (I'm using the
"account" client/application but I think this may be irrelevant for this
matter) I get two different results:

   - on some computers I can login and logout several times using any given
   account. After doing so if I search the user by email in the Users section
   of KC's admin console I see a single entry. This is fine!
   - on some other computers, however, I can login for the first time but
   if I try to login a second time I get a PersistenceException complaining
   about Unique index or primary key violation (...) ON
   PUBLIC.USER_ENTITY(REALM_ID, USERNAME) (....). If I search for this user's
   email on KC's admin console I now see two entries: the one coming from my
   external source and an extra create by KC.

This was also tested on KC 4.8.2 with the exact same results. Have you seen
this before? Any ideas about what the problem may be?


Regards,
Leandro Nunes


More information about the keycloak-user mailing list