docs: protected String getLdapPrincipalIdentifier(final String username, final LdapEntry ldapEntry) throws LoginException {
          if (StringUtils.isNotBlank(this.principalIdAttribute)) {
              val principalAttr = ldapEntry.getAttribute(this.principalIdAttribute);
              if (principalAttr == null || principalAttr.size() == 0) {
                  if (this.allowMissingPrincipalAttributeValue) {
                      LOGGER.warn("The principal id attribute [{}] is not found. CAS cannot construct the final authenticated principal "
                              + "if it's unable to locate the attribute that is designated as the principal id. "
                              + "Attributes available on the LDAP entry are [{}]. Since principal id attribute is not available, CAS will "
                              + "fall back to construct the principal based on the provided user id: [{}]",
                          this.principalIdAttribute, ldapEntry.getAttributes(), username);
                      return username;
                  }
                  LOGGER.error("The principal id attribute [{}] is not found. CAS is configured to disallow missing principal attributes",
                      this.principalIdAttribute);
                  throw new LoginException("Principal id attribute is not found for " + principalAttr);
              }
              val value = principalAttr.getStringValue();
              if (principalAttr.size() > 1) {
                  if (!this.allowMultiplePrincipalAttributeValues) {
                      throw new LoginException("Multiple principal values are not allowed: " + principalAttr);
                  }
                  LOGGER.warn("Found multiple values for principal id attribute: [{}]. Using first value=[{}].", principalAttr, value);
              }
              LOGGER.debug("Retrieved principal id attribute [{}]", value);
              return value;
          }
          LOGGER.debug("Principal id attribute is not defined. Using the default provided user id [{}]", username);
          return username;
      }