105 if (authPref != null) {
106 authPref = authPref.toLowerCase();
107 if(authPref.equals("spnego") || authPref.equals("kerberos")) {
108 authPref = "negotiate";
109 }
110 }
111 }
112
113 String hdrname; // Name of the header to look for
114
115 /**
116 * parse a set of authentication headers and choose the preferred scheme
117 * that we support for a given host
118 */
119 public AuthenticationHeader (String hdrname, MessageHeader response,
120 HttpCallerInfo hci, boolean dontUseNegotiate) {
121 this.hci = hci;
122 this.dontUseNegotiate = dontUseNegotiate;
123 rsp = response;
124 this.hdrname = hdrname;
125 schemes = new HashMap<String,SchemeMapValue>();
126 parse();
127 }
128
129 public HttpCallerInfo getHttpCallerInfo() {
130 return hci;
131 }
132 /* we build up a map of scheme names mapped to SchemeMapValue objects */
133 static class SchemeMapValue {
134 SchemeMapValue (HeaderParser h, String r) {raw=r; parser=h;}
135 String raw;
136 HeaderParser parser;
137 }
138
139 HashMap<String, SchemeMapValue> schemes;
140
141 /* Iterate through each header line, and then within each line.
142 * If multiple entries exist for a particular scheme (unlikely)
143 * then the last one will be used. The
144 * preferred scheme that we support will be used.
145 */
|
105 if (authPref != null) {
106 authPref = authPref.toLowerCase();
107 if(authPref.equals("spnego") || authPref.equals("kerberos")) {
108 authPref = "negotiate";
109 }
110 }
111 }
112
113 String hdrname; // Name of the header to look for
114
115 /**
116 * parse a set of authentication headers and choose the preferred scheme
117 * that we support for a given host
118 */
119 public AuthenticationHeader (String hdrname, MessageHeader response,
120 HttpCallerInfo hci, boolean dontUseNegotiate) {
121 this.hci = hci;
122 this.dontUseNegotiate = dontUseNegotiate;
123 rsp = response;
124 this.hdrname = hdrname;
125 schemes = new HashMap<>();
126 parse();
127 }
128
129 public HttpCallerInfo getHttpCallerInfo() {
130 return hci;
131 }
132 /* we build up a map of scheme names mapped to SchemeMapValue objects */
133 static class SchemeMapValue {
134 SchemeMapValue (HeaderParser h, String r) {raw=r; parser=h;}
135 String raw;
136 HeaderParser parser;
137 }
138
139 HashMap<String, SchemeMapValue> schemes;
140
141 /* Iterate through each header line, and then within each line.
142 * If multiple entries exist for a particular scheme (unlikely)
143 * then the last one will be used. The
144 * preferred scheme that we support will be used.
145 */
|