我试图使用java.But adal4j库我必须通过proxy.Following连接到连接Azure是ADAL4j Java代理问题
String url = "https://login.microsoftonline.com/tenant_id/oauth2/authorize";
authContext = new AuthenticationContext(url,false,
service);
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("proxyhostname", 443));
authContext.setProxy(proxy);
ClientCredential clientCred = new ClientCredential(XXXX, xxxx);
Future<AuthenticationResult> future = authContext.acquireToken(
clientCred,
null);
authResult = future.get();
而且我有
System.setProperty("http.proxyPort", "80");
System.setProperty("http.proxyUser", "xxxx");
System.setProperty("http.proxyPassword", "xxxx");
System.setProperty("http.proxyHost", "xxxxxxx");
试图将代码段
而且所有的时间我得到这个下面的错误
the error is.....java.net.ConnectException: Connection timed out: connect
java.util.concurrent.ExecutionException: java.net.ConnectException: Connection timed out: connect
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:188)
at com.toyota.eap.auth.Test.main(Test.java:76)
Caused by: java.net.ConnectException: Connection timed out: connect
注:此错误是,只有当我们拥有代理在办公室内。从办公室外面如果我跑这个节目,没有问题。
任何想到这一点。
感谢
对于通过Java代理访问AAD,可以查看http://stackoverflow.com/questions/32522773/adal-for-java-proxy/32558897。同时,请使用Proxy检查办公室网络,并确保它可用且有效。 –