private Mono<OAuth2AuthorizedClient> buildAuthorizedClient(final OAuth2AuthenticationToken oauth2Authentication) {
        String clientRegistrationId = oauth2Authentication.getAuthorizedClientRegistrationId();
        String name = oauth2Authentication.getName();
        ReactiveOAuth2AuthorizedClientService clientService = authorizedClientServiceProvider.getIfAvailable();
        if (Objects.isNull(clientService)) {
            return Mono.error(new IllegalStateException(
                    "ReactiveOAuth2AuthorizedClientService bean was found. you have to add "
                            + " spring-boot-starter-oauth2-client dependency?"));
        }
        return clientService.loadAuthorizedClient(clientRegistrationId, name);
    }
Instantiates a new oauth2 plugin.

@param authorizedClientServiceProvider the authorized client service provider
shenyu-plugin/shenyu-plugin-security/shenyu-plugin-oauth2/src/main/java/org/apache/shenyu/plugin/oauth2/OAuth2Plugin.java