@Override
    protected Mono<Void> doExecute(final ServerWebExchange exchange, final ShenyuPluginChain chain, final SelectorData selector, final RuleData rule) {
        String authorization = StringUtils.defaultString(exchange.getRequest().getHeaders().getFirst(HttpHeaders.AUTHORIZATION), exchange.getRequest().getURI().getUserInfo());
        BasicAuthRuleHandle basicAuthRuleHandle = BasicAuthPluginDataHandler.CACHED_HANDLE.get().obtainHandle(CacheKeyUtils.INST.getKey(rule));
        BasicAuthAuthenticationStrategy authenticationStrategy = Optional.ofNullable(basicAuthRuleHandle).map(BasicAuthRuleHandle::getBasicAuthAuthenticationStrategy).orElse(null);

        if (Objects.nonNull(authenticationStrategy) && authenticationStrategy.authenticate(basicAuthRuleHandle, authorization)) {
            return chain.execute(exchange);
        }
        return WebFluxResultUtils.result(exchange, ShenyuResultWrap.error(exchange, ShenyuResultEnum.ERROR_TOKEN));
    }
this is Template Method child has Implement your own logic.

@param exchange exchange the current server exchange {@linkplain ServerWebExchange}
@param chain    chain the current chain  {@linkplain ServerWebExchange}
@param selector selector    {@linkplain SelectorData}
@param rule     rule    {@linkplain RuleData}
@return {@code Mono<Void>} to indicate when request handling is complete
shenyu-plugin/shenyu-plugin-security/shenyu-plugin-basic-auth/src/main/java/org/apache/shenyu/plugin/basic/auth/BasicAuthPlugin.java