code: private void handleAuthResponse(final ChannelHandlerContext ctx, final ByteBuf msg) throws Exception {
      if (saslClient.isComplete()) {
        checkIsAuthed(ctx, MessageUtil.getResponseStatus(msg));
        return;
      }
  
      ByteBuf challengeBuf = SaslAuthResponse.challenge(msg);
      byte[] challenge = new byte[challengeBuf.readableBytes()];
      challengeBuf.readBytes(challenge);
      byte[] evaluatedBytes = saslClient.evaluateChallenge(challenge);
  
      if (evaluatedBytes != null) {
        ByteBuf content;
  
        // This is needed against older server versions where the protocol does not
        // align on cram and plain, the else block is used for all the newer cram-sha*
        // mechanisms.
        //
        // Note that most likely this is only executed in the CRAM-MD5 case only, but
        // just to play it safe keep it for both mechanisms.
        if (selectedMechanism.equals("CRAM-MD5") || selectedMechanism.equals("PLAIN")) {
          String[] evaluated = new String(evaluatedBytes).split(" ");
          content = Unpooled.copiedBuffer(username + "\0" + evaluated[1], CharsetUtil.UTF_8);
        } else {
          content = Unpooled.wrappedBuffer(evaluatedBytes);
        }
  
        ByteBuf request = ctx.alloc().buffer();
        SaslStepRequest.init(request);
        SaslStepRequest.mechanism(selectedMechanism, request);
        SaslStepRequest.challengeResponse(content, request);
  
        ChannelFuture future = ctx.writeAndFlush(request);
        future.addListener(new GenericFutureListener<Future<Void>>() {
          @Override
          public void operationComplete(Future<Void> future) throws Exception {
            if (!future.isSuccess()) {
              LOGGER.warn("Error during SASL Auth negotiation phase.", future);
              originalPromise().setFailure(future.cause());
            }
          }
        });
      } else {
        throw new AuthenticationException("SASL Challenge evaluation returned null.");
      }
  
    }
docs: Runs the SASL challenge protocol and dispatches the next step if required.