8de81d094958f08c4e85f7c7d5bb8495f668305d
[platform/upstream/curl.git] / tests / data / test2030
1 <testcase>
2 <info>
3 <keywords>
4 HTTP
5 HTTP GET
6 HTTP Digest auth
7 HTTP NTLM auth
8 </keywords>
9 </info>
10 # Server-side
11 <reply>
12
13 <!-- Alternate the order that Digest and NTLM headers appear in responses to
14 ensure that the order doesn't matter. -->
15
16 <!--
17
18  Explanation for the duplicate 400 requests:
19
20  libcurl doesn't detect that a given Digest password is wrong already on the
21  first 401 response (as the data400 gives). libcurl will instead consider the
22  new response just as a duplicate and it sends another and detects the auth
23  problem on the second 401 response!
24
25 -->
26
27
28 <!-- First request has NTLM auth, wrong password -->
29 <data100>
30 HTTP/1.1 401 Need Digest or NTLM auth\r
31 Server: Microsoft-IIS/5.0\r
32 Content-Type: text/html; charset=iso-8859-1\r
33 Content-Length: 27\r
34 WWW-Authenticate: NTLM\r
35 WWW-Authenticate: Digest realm="testrealm", nonce="1"\r
36 \r
37 This is not the real page!
38 </data100>
39
40 <data1101>
41 HTTP/1.1 401 NTLM intermediate\r
42 Server: Microsoft-IIS/5.0\r
43 Content-Type: text/html; charset=iso-8859-1\r
44 Content-Length: 33\r
45 WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=\r
46 \r
47 This is still not the real page!
48 </data1101>
49
50 <data1102>
51 HTTP/1.1 401 Sorry wrong password\r
52 Server: Microsoft-IIS/5.0\r
53 Content-Type: text/html; charset=iso-8859-1\r
54 Content-Length: 29\r
55 WWW-Authenticate: Digest realm="testrealm", nonce="2"\r
56 WWW-Authenticate: NTLM\r
57 \r
58 This is a bad password page!
59 </data1102>
60
61 <!-- Second request has Digest auth, right password -->
62 <data200>
63 HTTP/1.1 401 Need Digest or NTLM auth (2)\r
64 Server: Microsoft-IIS/5.0\r
65 Content-Type: text/html; charset=iso-8859-1\r
66 Content-Length: 27\r
67 WWW-Authenticate: NTLM\r
68 WWW-Authenticate: Digest realm="testrealm", nonce="3"\r
69 \r
70 This is not the real page!
71 </data200>
72
73 <data1200>
74 HTTP/1.1 200 Things are fine in server land\r
75 Server: Microsoft-IIS/5.0\r
76 Content-Type: text/html; charset=iso-8859-1\r
77 Content-Length: 32\r
78 \r
79 Finally, this is the real page!
80 </data1200>
81
82 <!-- Third request has NTLM auth, wrong password -->
83 <data300>
84 HTTP/1.1 401 Need Digest or NTLM auth (3)\r
85 Server: Microsoft-IIS/5.0\r
86 Content-Type: text/html; charset=iso-8859-1\r
87 Content-Length: 27\r
88 WWW-Authenticate: Digest realm="testrealm", nonce="4"\r
89 WWW-Authenticate: NTLM\r
90 \r
91 This is not the real page!
92 </data300>
93
94 <data1301>
95 HTTP/1.1 401 NTLM intermediate (2)\r
96 Server: Microsoft-IIS/5.0\r
97 Content-Type: text/html; charset=iso-8859-1\r
98 Content-Length: 33\r
99 WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=\r
100 \r
101 This is still not the real page!
102 </data1301>
103
104 <data1302>
105 HTTP/1.1 401 Sorry wrong password (2)\r
106 Server: Microsoft-IIS/5.0\r
107 Content-Type: text/html; charset=iso-8859-1\r
108 Content-Length: 29\r
109 WWW-Authenticate: NTLM\r
110 WWW-Authenticate: Digest realm="testrealm", nonce="5"\r
111 \r
112 This is a bad password page!
113 </data1302>
114
115 <!-- Fourth request has Digest auth, wrong password -->
116 <data400>
117 HTTP/1.1 401 Need Digest or NTLM auth (4)\r
118 Server: Microsoft-IIS/5.0\r
119 Content-Type: text/html; charset=iso-8859-1\r
120 Content-Length: 27\r
121 WWW-Authenticate: Digest realm="testrealm", nonce="6"\r
122 WWW-Authenticate: NTLM\r
123 \r
124 This is not the real page!
125 </data400>
126
127 <data1400>
128 HTTP/1.1 401 Sorry wrong password (3)\r
129 Server: Microsoft-IIS/5.0\r
130 Content-Type: text/html; charset=iso-8859-1\r
131 Content-Length: 29\r
132 WWW-Authenticate: NTLM\r
133 WWW-Authenticate: Digest realm="testrealm", nonce="7"\r
134 \r
135 This is a bad password page!
136 </data1400>
137
138 <!-- Fifth request has Digest auth, right password -->
139 <data500>
140 HTTP/1.1 401 Need Digest or NTLM auth (5)\r
141 Server: Microsoft-IIS/5.0\r
142 Content-Type: text/html; charset=iso-8859-1\r
143 Content-Length: 27\r
144 WWW-Authenticate: Digest realm="testrealm", nonce="8"\r
145 WWW-Authenticate: NTLM\r
146 \r
147 This is not the real page!
148 </data500>
149
150 <data1500>
151 HTTP/1.1 200 Things are fine in server land (2)\r
152 Server: Microsoft-IIS/5.0\r
153 Content-Type: text/html; charset=iso-8859-1\r
154 Content-Length: 32\r
155 \r
156 Finally, this is the real page!
157 </data1500>
158
159 <datacheck>
160 HTTP/1.1 401 NTLM intermediate\r
161 Server: Microsoft-IIS/5.0\r
162 Content-Type: text/html; charset=iso-8859-1\r
163 Content-Length: 33\r
164 WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=\r
165 \r
166 HTTP/1.1 401 Sorry wrong password\r
167 Server: Microsoft-IIS/5.0\r
168 Content-Type: text/html; charset=iso-8859-1\r
169 Content-Length: 29\r
170 WWW-Authenticate: Digest realm="testrealm", nonce="2"\r
171 WWW-Authenticate: NTLM\r
172 \r
173 This is a bad password page!
174 HTTP/1.1 200 Things are fine in server land\r
175 Server: Microsoft-IIS/5.0\r
176 Content-Type: text/html; charset=iso-8859-1\r
177 Content-Length: 32\r
178 \r
179 Finally, this is the real page!
180 HTTP/1.1 401 NTLM intermediate (2)\r
181 Server: Microsoft-IIS/5.0\r
182 Content-Type: text/html; charset=iso-8859-1\r
183 Content-Length: 33\r
184 WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=\r
185 \r
186 HTTP/1.1 401 Sorry wrong password (2)\r
187 Server: Microsoft-IIS/5.0\r
188 Content-Type: text/html; charset=iso-8859-1\r
189 Content-Length: 29\r
190 WWW-Authenticate: NTLM\r
191 WWW-Authenticate: Digest realm="testrealm", nonce="5"\r
192 \r
193 This is a bad password page!
194 HTTP/1.1 401 Sorry wrong password (3)\r
195 Server: Microsoft-IIS/5.0\r
196 Content-Type: text/html; charset=iso-8859-1\r
197 Content-Length: 29\r
198 WWW-Authenticate: NTLM\r
199 WWW-Authenticate: Digest realm="testrealm", nonce="7"\r
200 \r
201 HTTP/1.1 401 Sorry wrong password (3)\r
202 Server: Microsoft-IIS/5.0\r
203 Content-Type: text/html; charset=iso-8859-1\r
204 Content-Length: 29\r
205 WWW-Authenticate: NTLM\r
206 WWW-Authenticate: Digest realm="testrealm", nonce="7"\r
207 \r
208 This is a bad password page!
209 HTTP/1.1 200 Things are fine in server land (2)\r
210 Server: Microsoft-IIS/5.0\r
211 Content-Type: text/html; charset=iso-8859-1\r
212 Content-Length: 32\r
213 \r
214 Finally, this is the real page!
215 </datacheck>
216
217 </reply>
218
219 # Client-side
220 <client>
221 <features>
222 NTLM
223 </features>
224 <server>
225 http
226 </server>
227 <tool>
228 libauthretry
229 </tool>
230
231  <name>
232 HTTP authorization retry (NTLM switching to Digest)
233  </name>
234  <setenv>
235 # we force our own host name, in order to make the test machine independent
236 CURL_GETHOSTNAME=curlhost
237 # we try to use the LD_PRELOAD hack, if not a debug build
238 LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
239  </setenv>
240  <command>
241 http://%HOSTIP:%HTTPPORT/2030 ntlm digest
242 </command>
243 <precheck>
244 chkhostname curlhost
245 </precheck>
246 </client>
247
248 # Verify data after the test has been "shot"
249 <verify>
250 <strip>
251 ^User-Agent:.*
252 </strip>
253 <protocol>
254 GET /20300100 HTTP/1.1\r
255 Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=\r
256 Host: %HOSTIP:%HTTPPORT\r
257 Accept: */*\r
258 \r
259 GET /20300100 HTTP/1.1\r
260 Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyY3VybGhvc3Q=\r
261 Host: %HOSTIP:%HTTPPORT\r
262 Accept: */*\r
263 \r
264 GET /20300200 HTTP/1.1\r
265 Authorization: Digest username="testuser", realm="testrealm", nonce="2", uri="/20300200", response="2f2d784ba53a0a307758a90e98d25c27"\r
266 Host: %HOSTIP:%HTTPPORT\r
267 Accept: */*\r
268 \r
269 GET /20300300 HTTP/1.1\r
270 Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=\r
271 Host: %HOSTIP:%HTTPPORT\r
272 Accept: */*\r
273 \r
274 GET /20300300 HTTP/1.1\r
275 Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyY3VybGhvc3Q=\r
276 Host: %HOSTIP:%HTTPPORT\r
277 Accept: */*\r
278 \r
279 GET /20300400 HTTP/1.1\r
280 Authorization: Digest username="testuser", realm="testrealm", nonce="5", uri="/20300400", response="d6262e9147db08c62ff2f53b515861e8"\r
281 Host: %HOSTIP:%HTTPPORT\r
282 Accept: */*\r
283 \r
284 GET /20300400 HTTP/1.1\r
285 Authorization: Digest username="testuser", realm="testrealm", nonce="5", uri="/20300400", response="d6262e9147db08c62ff2f53b515861e8"\r
286 Host: %HOSTIP:%HTTPPORT\r
287 Accept: */*\r
288 \r
289 GET /20300500 HTTP/1.1\r
290 Authorization: Digest username="testuser", realm="testrealm", nonce="7", uri="/20300500", response="198757e61163a779cf24ed4c49c1ad7d"\r
291 Host: %HOSTIP:%HTTPPORT\r
292 Accept: */*\r
293 \r
294 </protocol>
295 </verify>
296 </testcase>