return defaultLdapContextFactory;
}
public static LdapAuthConfiguration getLdapAuthConfiguration(CLdapServerConfiguration ldapServer) {
CUserAndGroupAuthConfiguration userAndGroupsConf = ldapServer.getUserAndGroupConfig();
LdapAuthConfiguration authConfig = new LdapAuthConfiguration();
authConfig.setEmailAddressAttribute(userAndGroupsConf.getEmailAddressAttribute());
authConfig.setUserBaseDn(StringUtils.defaultString(userAndGroupsConf.getUserBaseDn(), ""));
authConfig.setUserIdAttribute(userAndGroupsConf.getUserIdAttribute());
authConfig.setUserObjectClass(userAndGroupsConf.getUserObjectClass());
authConfig.setPasswordAttribute(userAndGroupsConf.getUserPasswordAttribute());
authConfig.setUserRealNameAttribute(userAndGroupsConf.getUserRealNameAttribute());
authConfig.setGroupBaseDn(StringUtils.defaultString(userAndGroupsConf.getGroupBaseDn(), ""));
authConfig.setGroupIdAttribute(userAndGroupsConf.getGroupIdAttribute());
authConfig.setGroupMemberAttribute(userAndGroupsConf.getGroupMemberAttribute());
authConfig.setGroupMemberFormat(userAndGroupsConf.getGroupMemberFormat());
authConfig.setGroupObjectClass(userAndGroupsConf.getGroupObjectClass());
authConfig.setUserSubtree(userAndGroupsConf.isUserSubtree());
authConfig.setGroupSubtree(userAndGroupsConf.isGroupSubtree());
authConfig.setUserMemberOfAttribute(userAndGroupsConf.getUserMemberOfAttribute());
authConfig.setLdapGroupsAsRoles(userAndGroupsConf.isLdapGroupsAsRoles());
authConfig.setLdapFilter(userAndGroupsConf.getLdapFilter());
return authConfig;
}