ADAL for java: Resolving dependencies for java client app sample

我只是一个虾纸丫 提交于 2020-01-06 17:56:08

问题


Are there any instructions available to run public-client-app-sample in ADAL for Java ? After building the sample jar and library jar files, an attempt to run "java -cp adal4j-0.1.0.jar;public-client-app-sample.jar PublicClient" yields (after entering the credentials) Exception in thread "main" java.lang.NoClassDefFoundError: com/nimbusds/oauth2/s dk/AuthorizationGrant. What would be the appropriate classpath or is there a maven target?


回答1:


I just updated the code to include exec plugin in the sample. Simply use mvn exec:java to run the sample. I verified that it works




回答2:


The 0.1.0 version of the adal4j maven library is unresolvable neither in com.microsoft.azure, nor in com.microsoft.aad. Here is the search result from maven central to confirm that:

http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22adal4j%22

When changing the adal4j to the latest available version (0.0.3) the following exception is produced:

Caused by: java.net.MalformedURLException: no protocol: at java.net.URL.<init>(URL.java:585) at java.net.URL.<init>(URL.java:482) at java.net.URL.<init>(URL.java:431) at com.microsoft.aad.adal4j.HttpHelper.openConnection(HttpHelper.java:110) at com.microsoft.aad.adal4j.HttpHelper.executeHttpGet(HttpHelper.java:43) at com.microsoft.aad.adal4j.HttpHelper.executeHttpGet(HttpHelper.java:38) at com.microsoft.aad.adal4j.MexParser.getWsTrustEndpointFromMexEndpoint(MexParser.java:87) at com.microsoft.aad.adal4j.AuthenticationContext.processPasswordGrant(AuthenticationContext.java:747) at com.microsoft.aad.adal4j.AuthenticationContext.access$000(AuthenticationContext.java:61) at com.microsoft.aad.adal4j.AuthenticationContext$1.call(AuthenticationContext.java:127) at com.microsoft.aad.adal4j.AuthenticationContext$1.call(AuthenticationContext.java:117) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)



来源:https://stackoverflow.com/questions/29380910/adal-for-java-resolving-dependencies-for-java-client-app-sample

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!