File tree 2 files changed +62
-0
lines changed 2 files changed +62
-0
lines changed Original file line number Diff line number Diff line change 223
223
</extensions >
224
224
<defaultGoal >install</defaultGoal >
225
225
<plugins >
226
+ <plugin >
227
+ <groupId >org.apache.maven.plugins</groupId >
228
+ <artifactId >maven-shade-plugin</artifactId >
229
+ <version >2.0</version >
230
+ <executions >
231
+ <execution >
232
+ <phase >package</phase >
233
+ <goals >
234
+ <goal >shade</goal >
235
+ </goals >
236
+ <configuration >
237
+ <finalName >microbenchmarks</finalName >
238
+ <transformers >
239
+ <transformer
240
+ implementation =" org.apache.maven.plugins.shade.resource.ManifestResourceTransformer" >
241
+ <mainClass >ntlm.Ntlm</mainClass >
242
+ </transformer >
243
+ </transformers >
244
+ </configuration >
245
+ </execution >
246
+ </executions >
247
+ </plugin >
248
+
249
+
250
+
226
251
<plugin >
227
252
<groupId >org.apache.maven.plugins</groupId >
228
253
<artifactId >maven-compiler-plugin</artifactId >
Original file line number Diff line number Diff line change
1
+ package ntlm ;
2
+
3
+ import com .ning .http .client .AsyncHttpClient ;
4
+ import com .ning .http .client .AsyncHttpClientConfig ;
5
+ import com .ning .http .client .Realm ;
6
+ import com .ning .http .client .Response ;
7
+ import com .ning .http .client .Realm .AuthScheme ;
8
+ import com .ning .http .client .providers .jdk .JDKAsyncHttpProvider ;
9
+
10
+ import java .io .IOException ;
11
+ import java .util .concurrent .ExecutionException ;
12
+
13
+ public class Ntlm {
14
+
15
+ public static void main (String [] args ) throws InterruptedException , ExecutionException , IOException {
16
+
17
+ Realm realm = new Realm .RealmBuilder ()//
18
+ .setPrincipal ("corpsignon" )//
19
+ .setPassword ("Tester$1234" )//
20
+ .setUsePreemptiveAuth (true )//
21
+ .setNtlmDomain ("SIGNONTESTER.CORP.ORG" )
22
+ .setNtlmHost ("NTLMTESTER" )//
23
+ .setScheme (AuthScheme .NTLM ).build ();
24
+
25
+ AsyncHttpClientConfig .Builder builder = new AsyncHttpClientConfig .Builder ().setRealm (realm );
26
+
27
+ AsyncHttpClient client = new AsyncHttpClient (JDKAsyncHttpProvider .class .getName (), builder .build ());
28
+
29
+ try {
30
+ Response response = client .prepareGet ("http://localhost:8080" ).execute ().get ();
31
+
32
+ System .err .println (response .getStatusCode ());
33
+ } finally {
34
+ client .close ();
35
+ }
36
+ }
37
+ }
You can’t perform that action at this time.
0 commit comments