From 16690a03294792ff8d77c05aac6ccb105f22e6f1 Mon Sep 17 00:00:00 2001 From: Maxime Dor Date: Wed, 6 Dec 2017 20:31:06 +0100 Subject: [PATCH] Enforce baseDn for LDAP provider --- src/main/java/io/kamax/mxisd/config/ldap/LdapConfig.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/kamax/mxisd/config/ldap/LdapConfig.java b/src/main/java/io/kamax/mxisd/config/ldap/LdapConfig.java index 3211499..565ed08 100644 --- a/src/main/java/io/kamax/mxisd/config/ldap/LdapConfig.java +++ b/src/main/java/io/kamax/mxisd/config/ldap/LdapConfig.java @@ -162,11 +162,14 @@ public class LdapConfig { throw new IllegalStateException("LDAP port is not valid"); } + if (StringUtils.isBlank(conn.getBaseDn())) { + throw new ConfigurationException("ldap.connection.baseDn"); + } + if (StringUtils.isBlank(attribute.getUid().getType())) { throw new IllegalStateException("Attribute UID Type cannot be empty"); } - if (StringUtils.isBlank(attribute.getUid().getValue())) { throw new IllegalStateException("Attribute UID value cannot be empty"); }