code: private String formatDn(String dnPattern, String username, ApiRequest request) {
          Map<String, String> valuesMap = request.getHeaders().toMap();
          valuesMap.put("username", username); //$NON-NLS-1$
          StrSubstitutor sub = new StrSubstitutor(valuesMap);
          return sub.replace(dnPattern);
      }
docs: Formats the configured DN by replacing any properties it finds.
  @param dnPattern
  @param username
  @param request