I have implemented webclient and oAuth2 with grant type Client Credentials. I must use proxy to access bureau. But webclient is not using the host which I have configured.
HttpClient httpClient = HttpClient.create()
.tcpConfiguration(tcpClient -> tcpClient.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, connectionTimeout)
.doOnConnected(conn -> conn.addHandlerLast(new ReadTimeoutHandler(readTimeout, TimeUnit.MILLISECONDS)))
.proxy(proxy -> proxy.type(ProxyProvider.Proxy.HTTP).host(proxyHost).port(proxyPort)));
its working fine if I configure proxy with system :
System.setProperty("proxyHost", "host);
System.setProperty("proxyPort", "8080");
But I can't use System property over the cloud. Please suggest me some work around or any solution.
I am getting below exception: "org.springframework.security.oauth2.core.OAuth2AuthorizationException: [invalid_token_response] An error occurred while attempting to retrieve the OAuth 2.0 Access Token Response: I/O error on POST request for \"https://tokenURL": api.uat.equifax.com; nested exception is java.net.UnknownHostException: resourseURL\r\n\tat org.springframework.security.oauth2.client.endpoint.DefaultClientCredentialsTokenResponseClient.getTokenResponse(DefaultClientCredentialsTokenResponseClient.java:79)\r\n\tat ..."
"hostdoesn't look valid