# Keycloak JPA user federation from privacyIDEA DB

**URL:** <https://forum.keycloak.org/t/keycloak-jpa-user-federation-from-privacyidea-db/4090>\
**Category:** Getting advice\
**Created:** [August 3, 2020, 1:26pm UTC](https://forum.keycloak.org/t/keycloak-jpa-user-federation-from-privacyidea-db/4090 "2020-08-03T13:26:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maurice-Betzel](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@Maurice-Betzel](https://forum.keycloak.org/u/Maurice-Betzel)\
**Post date:** [August 3, 2020, 1:26pm UTC](https://forum.keycloak.org/t/keycloak-jpa-user-federation-from-privacyidea-db/4090/1 "2020-08-03T13:26:09Z")

</div>

Dear community, i have setup a Keycloak 11 server with privacyIDEA 3.3.3 for 2FA. Both get the internal users from a readonly LDAP and have a mysql DB for external users that we do not want in our AD.  
I have created a JPA user federation plugin connecting perfectly to the DB.  
If i add a user from privacyIDEA it displays OK in the Users lookup view, but if i go into the edit view the emial, first name and last name are missing all of a sudden.  
If a create a user i get a SQL exception emial cannot be null but it had been inserted into the form:

2020-08-03 13:24:10,577 WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (default task-207) SQL Error: 1048, SQLState: 23000  
2020-08-03 13:24:10,577 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (default task-207) Column ‘email’ cannot be null

Any ideas?
