From 79dede8e78f5349d1124399d31fc1e9fb31dec93 Mon Sep 17 00:00:00 2001 From: Bill Burke Date: Wed, 1 Feb 2017 10:19:15 -0500 Subject: [PATCH] KEYCLOAK-4363 --- .../KerberosFederationProviderFactory.java | 2 +- .../ldap/LDAPStorageProviderFactory.java | 4 +-- .../keycloak/models/utils/ComponentUtil.java | 2 +- .../keycloak/component/ComponentFactory.java | 25 ++++++++++++++++++- 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/KerberosFederationProviderFactory.java b/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/KerberosFederationProviderFactory.java index 92bd48e992..e061f5eeb3 100755 --- a/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/KerberosFederationProviderFactory.java +++ b/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/KerberosFederationProviderFactory.java @@ -151,7 +151,7 @@ public class KerberosFederationProviderFactory implements UserStorageProviderFac } @Override - public void onUpdate(KeycloakSession session, RealmModel realm, ComponentModel model) { + public void onUpdate(KeycloakSession session, RealmModel realm, ComponentModel oldModel, ComponentModel newModel) { CredentialHelper.setOrReplaceAuthenticationRequirement(session, realm, CredentialRepresentation.KERBEROS, AuthenticationExecutionModel.Requirement.ALTERNATIVE, AuthenticationExecutionModel.Requirement.DISABLED); } diff --git a/federation/ldap/src/main/java/org/keycloak/storage/ldap/LDAPStorageProviderFactory.java b/federation/ldap/src/main/java/org/keycloak/storage/ldap/LDAPStorageProviderFactory.java index 6d60ee7f87..81991570c0 100755 --- a/federation/ldap/src/main/java/org/keycloak/storage/ldap/LDAPStorageProviderFactory.java +++ b/federation/ldap/src/main/java/org/keycloak/storage/ldap/LDAPStorageProviderFactory.java @@ -375,8 +375,8 @@ public class LDAPStorageProviderFactory implements UserStorageProviderFactory ex return null; } + /** + * Called before a component is created or updated. Allows you to validate the configuration + * + * @param session + * @param realm + * @param model + * @throws ComponentValidationException + */ default void validateConfiguration(KeycloakSession session, RealmModel realm, ComponentModel model) throws ComponentValidationException { } + /** + * Called after a component is created + * + * @param session + * @param realm + * @param model + */ default void onCreate(KeycloakSession session, RealmModel realm, ComponentModel model) { } + /** + * Called after the component is updated. + * + * @param session + * @param realm + * @param oldModel old saved model + * @param newModel new configuration + */ default - void onUpdate(KeycloakSession session, RealmModel realm, ComponentModel model) { + void onUpdate(KeycloakSession session, RealmModel realm, ComponentModel oldModel, ComponentModel newModel) { }