class HttpBasicAuthHandler
            extends AbstractAuthenticationHandler {

        private final Base64.Decoder decoder = Base64.getUrlDecoder();

        public HttpBasicAuthHandler(Authenticator authenticator) {
            super(authenticator);
        }

        @Override
        public void channelRead(ChannelHandlerContext ctx, Object msg) {<FILL_FUNCTION_BODY>}

        private void sendError(ChannelHandlerContext context, Object msg) {
            // Close the connection as soon as the error message is sent.
            context.writeAndFlush(new DefaultFullHttpResponse(HTTP_1_1, UNAUTHORIZED))
                   .addListener(ChannelFutureListener.CLOSE);
            ReferenceCountUtil.release(msg);
        }
    }

            if (msg instanceof FullHttpMessage) {
                final FullHttpMessage request = (FullHttpMessage) msg;
                if (!request.headers().contains("Authorization")) {
                    sendError(ctx, msg);
                    return;
                }

                // strip off "Basic " from the Authorization header (RFC 2617)
                final String basic = "Basic ";
                final String header = request.headers().get("Authorization");
                if (!header.startsWith(basic)) {
                    sendError(ctx, msg);
                    return;
                }
                byte[] userPass = null;
                try {
                    final String encoded = header.substring(basic.length());
                    userPass = this.decoder.decode(encoded);
                } catch (IndexOutOfBoundsException iae) {
                    sendError(ctx, msg);
                    return;
                } catch (IllegalArgumentException iae) {
                    sendError(ctx, msg);
                    return;
                }
                String authorization = new String(userPass,
                                                  StandardCharsets.UTF_8);
                String[] split = authorization.split(":");
                if (split.length != 2) {
                    sendError(ctx, msg);
                    return;
                }

                String address = ctx.channel().remoteAddress().toString();
                if (address.startsWith("/") && address.length() > 1) {
                    address = address.substring(1);
                }

                final Map<String, String> credentials = new HashMap<>();
                credentials.put(PROPERTY_USERNAME, split[0]);
                credentials.put(PROPERTY_PASSWORD, split[1]);
                credentials.put(HugeAuthenticator.KEY_ADDRESS, address);

                try {
                    this.authenticator.authenticate(credentials);
                    ctx.fireChannelRead(request);
                } catch (AuthenticationException ae) {
                    sendError(ctx, msg);
                }
            }
        
<no_super_class>