Azure / Azure/azure-documentdb-java

How to use with proxy username and password ?

Open
#76 3 comments 0 reactions 0 assignees View on GitHub
investigating
Dominant language
Java
Stars
51
Forks
52
PR merge metrics
No merged PRs in 30d

Description

Hii,
I am working behind the proxy network.
I tried arguments like following but it is not working.
```
-Dhttp.proxyHost=myproxy Dhttp.proxyPort=3128
-Dhttps.proxyHost=myproxy -Dhttps.proxyPort=3128
```
Following allows me add host and port of proxy, but I required to username and password as well.
`connectionPolicy.setProxy(new HttpHost(InetAddress.getByName("proxy.company.com"), 12345));`

I also tried following for authentication
```
final String authUser = "user";
final String authPassword = "password";
Authenticator.setDefault(
new Authenticator() {
@Override
public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(
authUser, authPassword.toCharArray());
}
}
);

System.setProperty("http.proxyUser", authUser);
System.setProperty("http.proxyPassword", authPassword);
```
How can I use username and password for authentication for proxy.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.