ADAL4j proxy issue for java #71
Comments
@mathewvino Do you have an issue when ADAL is not involved. i.e. can you reach other internet endpoints through the proxy outside of ADAL? |
Yes I can if i use the HTTPConnection call I am getting the output. Please find the code snippet import java.io.DataInputStream; public class Proxy5 {
} |
@mathewvino Does it make a difference that the port you specify in your code snippet at the top of this issue is port 443, which fails, but the port you put in your last snippet is port 80? |
Nope i have tried with 80 and then change it to 443. The exception throwing is Connection time out the error is.....java.net.ConnectException: Connection timed out: connect |
@mathewvino Is there any way you can run a Fiddler or Charles trace so we can see the actual responses back and forth? I have a feeling your proxy and our setProxy() aren't playing nice together. Knowing where in the hop it stops is always helpful. You can send the log to our email thread if it's sensitive. |
I am using windows machine and running java within eclipse.just download the fiddler and do the exact steps mentioned in http://dharampal.in/2013/07/03/capture-https-traffic-from-java-applications-with-fiddler/
I can see its fetching the token without any issue. But I think its using Fiddler as proxy but not the company proxy setting. probably there is a way we can set fiddler to go through the proxy. i am not sure.if i run the code with the following setting as mentioned with fiddler up and running we dont need to mention the proxy url like below.Either way its not using it. Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("proxy url", 80)); please share your thought on this. |
Hi there,
I am trying to connect azure using adal4j1.1 library for java.But i have to connect through the proxy.Following is the snippet of code
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 future = authContext.acquireToken(
clientCred,
null);
authResult = future.get();
Also i have tried with
And all the time i am getting this following error
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
Note: This error is only if we have proxy within the office. From outside the office If I ran thisprogramme there is no issue.
Any Thought on this.
Thanks
The text was updated successfully, but these errors were encountered: