diff --git a/openmetadata-clients/openmetadata-java-client/src/main/java/org/openmetadata/client/gateway/OpenMetadata.java b/openmetadata-clients/openmetadata-java-client/src/main/java/org/openmetadata/client/gateway/OpenMetadata.java index 2a71da64fe60..2fc7f2ac161c 100644 --- a/openmetadata-clients/openmetadata-java-client/src/main/java/org/openmetadata/client/gateway/OpenMetadata.java +++ b/openmetadata-clients/openmetadata-java-client/src/main/java/org/openmetadata/client/gateway/OpenMetadata.java @@ -51,13 +51,17 @@ public OpenMetadata(OpenMetadataConnection config, boolean validateVersion) { } public void initClient(OpenMetadataConnection config) { - apiClient = new ApiClient(); Feign.Builder builder = Feign.builder() .encoder(new FormEncoder(new JacksonEncoder(apiClient.getObjectMapper()))) .decoder(new JacksonDecoder(apiClient.getObjectMapper())) .logger(new Slf4jLogger()) .client(new OkHttpClient()); + initClient(config, builder); + } + + public void initClient(OpenMetadataConnection config, Feign.Builder builder) { + apiClient = new ApiClient(); apiClient.setFeignBuilder(builder); AuthenticationProviderFactory factory = new AuthenticationProviderFactory(); apiClient.addAuthorization("oauth", factory.getAuthProvider(config));