From 4cd617bc42bd719f49a30499d84d6b1c3d39004f Mon Sep 17 00:00:00 2001 From: Gideon Caranzo Date: Thu, 29 Nov 2018 10:51:07 -0600 Subject: [PATCH] KEYCLOAK-8977 Added method to return KeycloakSession from RealmCreationEvent --- .../main/java/org/keycloak/models/jpa/JpaRealmProvider.java | 4 ++++ server-spi/src/main/java/org/keycloak/models/RealmModel.java | 1 + 2 files changed, 5 insertions(+) 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 {