static void throwIfMissingRequiredCredentials(boolean requireAuthentication,
      boolean hasCredentials) {
    if (requireAuthentication && !hasCredentials) {
      throw new AuthenticationRequiredException(
          "No security credentials are provided");
    }
  }
Throws AuthenticationRequiredException if authentication is required but there are no
credentials.
geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/Handshake.java