@DataBoundConstructor
  public ReverseProxySecurityRealm(
      String forwardedUser,
      String headerGroups,
      String headerGroupsDelimiter,
      String server,
      String rootDN,
      boolean inhibitInferRootDN,
      String userSearchBase,
      String userSearch,
      String groupSearchBase,
      String groupSearchFilter,
      String groupMembershipFilter,
      String managerDN,
      String managerPassword,
      Integer updateInterval) {

    this.forwardedUser = fixEmptyAndTrim(forwardedUser);

    this.headerGroups = headerGroups;
    if (!StringUtils.isBlank(headerGroupsDelimiter)) {
      this.headerGroupsDelimiter = headerGroupsDelimiter.trim();
    } else {
      this.headerGroupsDelimiter = "|";
    }
    //
    this.server = fixEmptyAndTrim(server);
    this.managerDN = fixEmpty(managerDN);
    this.managerPassword = Scrambler.scramble(fixEmpty(managerPassword));
    this.inhibitInferRootDN = inhibitInferRootDN;

    if (this.server != null) {
      if (!inhibitInferRootDN && fixEmptyAndTrim(rootDN) == null)
        rootDN = fixNull(inferRootDN(server));
      this.rootDN = rootDN.trim();
    } else {
      this.rootDN = null;
    }

    this.userSearchBase = fixNull(userSearchBase).trim();
    userSearch = fixEmptyAndTrim(userSearch);
    this.userSearch = userSearch != null ? userSearch : "uid={0}";
    this.groupSearchBase = fixEmptyAndTrim(groupSearchBase);
    this.groupSearchFilter = fixEmptyAndTrim(groupSearchFilter);
    this.groupMembershipFilter = fixEmptyAndTrim(groupMembershipFilter);

    this.updateInterval =
        (updateInterval == null || updateInterval <= 0) ? CHECK_INTERVAL : updateInterval;

    authorities = new GrantedAuthority[0];
    authContext = new Hashtable<String, GrantedAuthority[]>();
    authorityUpdateCache = new Hashtable<String, Long>();
  }