code: public Principal authenticate() throws AlpineAuthenticationException {
          LOGGER.debug("Attempting to authenticate user: " + username);
          try (AlpineQueryManager qm = new AlpineQueryManager()) {
              final ManagedUser user = qm.getManagedUser(username);
              if (user != null) {
                  if (PasswordService.matches(password.toCharArray(), user)) {
                      if (user.isSuspended()) {
                          throw new AlpineAuthenticationException(AlpineAuthenticationException.CauseType.SUSPENDED, user);
                      }
                      if (user.isForcePasswordChange()) {
                          throw new AlpineAuthenticationException(AlpineAuthenticationException.CauseType.FORCE_PASSWORD_CHANGE, user);
                      }
                      return user;
                  }
              }
          }
          throw new AlpineAuthenticationException(AlpineAuthenticationException.CauseType.INVALID_CREDENTIALS);
      }
docs: Authenticates the username/password combo against the directory service
  and returns a Principal if authentication is successful. Otherwise,
  returns an AuthenticationException.
  
  @return a Principal if authentication was successful
  @throws AlpineAuthenticationException when authentication is unsuccessful
  @since 1.0.0