Search in sources :

Example 1 with FederatedUser

use of org.keycloak.storage.jpa.entity.FederatedUser in project keycloak by keycloak.

the class JpaUserFederatedStorageProvider method createIndex.

/**
 * We create an entry so that its easy to iterate over all things in the database.  Specifically useful for export
 */
protected void createIndex(RealmModel realm, String userId) {
    if (em.find(FederatedUser.class, userId) == null) {
        FederatedUser fedUser = new FederatedUser();
        fedUser.setId(userId);
        fedUser.setRealmId(realm.getId());
        fedUser.setStorageProviderId(new StorageId(userId).getProviderId());
        em.persist(fedUser);
    }
}
Also used : FederatedUser(org.keycloak.storage.jpa.entity.FederatedUser) StorageId(org.keycloak.storage.StorageId)

Aggregations

StorageId (org.keycloak.storage.StorageId)1 FederatedUser (org.keycloak.storage.jpa.entity.FederatedUser)1