I am trying to implement GraphClient, below is a sample code which is working fine...
ClientCredentialProvider authProvider =
new ClientCredentialProvider(clientId,
scopes,
clientSecret,
b2cTenant,
endpoint);
IGraphServiceClient graphClient = graphClient = GraphServiceClient.builder()
.authenticationProvider(authProvider)
.buildClient();
This is working fine...but in some case from where the code is being run, there is a proxy, so I need to setup proxy to connect to internet. I need to setup proxy and pass it to graphClient somehow to tell make a call via proxy.
I was trying to find a document but could not get any through I got this...
ProxyOptions proxyOptions = new ProxyOptions(ProxyOptions.Type.HTTP, new InetSocketAddress(proxyUrl, proxyPort));
proxyOptions.setCredentials(proxyUser, proxyPassword);
final UsernamePasswordCredential usernamePasswordCredential = new UsernamePasswordCredentialBuilder()
.clientId(clientId)
.username(username)
.password(password)
.httpClient(HttpClient.createDefault(new HttpClientOptions().setProxyOptions(proxyOptions)))
.build();
But the problem is the "ProxyOptions" isnt in Maven and I am not sure what library it is part of.
Can anyone suggest an idea.