Add event for ClientScope created (#30715)
closes #30795 Signed-off-by: Pascal Knüppel <pascal.knueppel@governikus.de>
This commit is contained in:
parent
220f32aa85
commit
c4ebd0cd0c
2 changed files with 22 additions and 1 deletions
|
@ -1021,8 +1021,23 @@ public class JpaRealmProvider implements RealmProvider, ClientProvider, ClientSc
|
||||||
entity.setName(name);
|
entity.setName(name);
|
||||||
entity.setRealmId(realm.getId());
|
entity.setRealmId(realm.getId());
|
||||||
em.persist(entity);
|
em.persist(entity);
|
||||||
|
|
||||||
|
ClientScopeModel clientScope = new ClientScopeAdapter(realm, em, session, entity);
|
||||||
|
session.getKeycloakSessionFactory().publish(new ClientScopeModel.ClientScopeCreatedEvent() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public KeycloakSession getKeycloakSession() {
|
||||||
|
return session;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ClientScopeModel getClientScope() {
|
||||||
|
return clientScope;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
em.flush();
|
em.flush();
|
||||||
return new ClientScopeAdapter(realm, em, session, entity);
|
return clientScope;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -34,6 +34,12 @@ public interface ClientScopeModel extends ProtocolMapperContainerModel, ScopeCon
|
||||||
KeycloakSession getKeycloakSession();
|
KeycloakSession getKeycloakSession();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface ClientScopeCreatedEvent extends ProviderEvent {
|
||||||
|
ClientScopeModel getClientScope();
|
||||||
|
|
||||||
|
KeycloakSession getKeycloakSession();
|
||||||
|
}
|
||||||
|
|
||||||
String getId();
|
String getId();
|
||||||
|
|
||||||
String getName();
|
String getName();
|
||||||
|
|
Loading…
Reference in a new issue