31
31
import org .asynchttpclient .util .StringUtils ;
32
32
33
33
/**
34
- * This class is required when authentication is needed. The class support
35
- * DIGEST and BASIC.
34
+ * This class is required when authentication is needed. The class support BASIC, DIGEST, NTLM, SPNEGO and KERBEROS.
36
35
*/
37
36
public class Realm {
38
37
@@ -64,16 +63,33 @@ public enum AuthScheme {
64
63
BASIC , DIGEST , NTLM , SPNEGO , KERBEROS ;
65
64
}
66
65
67
- private Realm (AuthScheme scheme , String principal , String password , String realmName , String nonce , String algorithm , String response , String qop , String nc , String cnonce ,
68
- Uri uri , String method , boolean usePreemptiveAuth , String ntlmDomain , Charset charset , String host , String opaque , boolean useAbsoluteURI , boolean omitQuery ) {
66
+ private Realm (AuthScheme scheme ,//
67
+ String principal ,//
68
+ String password ,//
69
+ String realmName ,//
70
+ String nonce ,//
71
+ String algorithm ,//
72
+ String response ,//
73
+ String opaque ,//
74
+ String qop ,//
75
+ String nc ,//
76
+ String cnonce ,//
77
+ Uri uri ,//
78
+ String methodName ,//
79
+ boolean usePreemptiveAuth ,//
80
+ Charset charset ,//
81
+ String ntlmDomain ,//
82
+ String ntlmHost ,//
83
+ boolean useAbsoluteURI ,//
84
+ boolean omitQuery ) {
69
85
70
86
assertNotNull (scheme , "scheme" );
71
87
assertNotNull (principal , "principal" );
72
88
assertNotNull (password , "password" );
73
89
90
+ this .scheme = scheme ;
74
91
this .principal = principal ;
75
92
this .password = password ;
76
- this .scheme = scheme ;
77
93
this .realmName = realmName ;
78
94
this .nonce = nonce ;
79
95
this .algorithm = algorithm ;
@@ -83,11 +99,11 @@ private Realm(AuthScheme scheme, String principal, String password, String realm
83
99
this .nc = nc ;
84
100
this .cnonce = cnonce ;
85
101
this .uri = uri ;
86
- this .methodName = method ;
102
+ this .methodName = methodName ;
87
103
this .usePreemptiveAuth = usePreemptiveAuth ;
88
- this .ntlmDomain = ntlmDomain ;
89
- this .ntlmHost = host ;
90
104
this .charset = charset ;
105
+ this .ntlmDomain = ntlmDomain ;
106
+ this .ntlmHost = ntlmHost ;
91
107
this .useAbsoluteURI = useAbsoluteURI ;
92
108
this .omitQuery = omitQuery ;
93
109
}
@@ -493,8 +509,25 @@ public Realm build() {
493
509
newResponse (md );
494
510
}
495
511
496
- return new Realm (scheme , principal , password , realmName , nonce , algorithm , response , qop , nc , cnonce , uri , methodName , usePreemptive , ntlmDomain , charset , ntlmHost ,
497
- opaque , useAbsoluteURI , omitQuery );
512
+ return new Realm (scheme ,//
513
+ principal ,//
514
+ password ,//
515
+ realmName ,//
516
+ nonce , //
517
+ algorithm , //
518
+ response ,//
519
+ opaque , //
520
+ qop , //
521
+ nc , //
522
+ cnonce , //
523
+ uri , //
524
+ methodName , //
525
+ usePreemptive , //
526
+ charset , //
527
+ ntlmDomain ,//
528
+ ntlmHost , //
529
+ useAbsoluteURI , //
530
+ omitQuery );
498
531
}
499
532
}
500
533
}
0 commit comments