diff --git a/model/jpa/src/main/java/org/keycloak/models/jpa/JpaRealmProvider.java b/model/jpa/src/main/java/org/keycloak/models/jpa/JpaRealmProvider.java index cf5835a21f..90b4bc57e7 100755 --- a/model/jpa/src/main/java/org/keycloak/models/jpa/JpaRealmProvider.java +++ b/model/jpa/src/main/java/org/keycloak/models/jpa/JpaRealmProvider.java @@ -81,6 +81,10 @@ public class JpaRealmProvider implements RealmProvider { public RealmModel getCreatedRealm() { return adapter; } + @Override + public KeycloakSession getKeycloakSession() { + return session; + } }); return adapter; } diff --git a/server-spi/src/main/java/org/keycloak/models/RealmModel.java b/server-spi/src/main/java/org/keycloak/models/RealmModel.java index 33323fd1f1..4a1261f819 100755 --- a/server-spi/src/main/java/org/keycloak/models/RealmModel.java +++ b/server-spi/src/main/java/org/keycloak/models/RealmModel.java @@ -34,6 +34,7 @@ import java.util.*; public interface RealmModel extends RoleContainerModel { interface RealmCreationEvent extends ProviderEvent { RealmModel getCreatedRealm(); + KeycloakSession getKeycloakSession(); } interface RealmPostCreateEvent extends ProviderEvent {