• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<testcase>
2<info>
3<keywords>
4HTTP
5HTTP GET
6HTTP Basic auth
7HTTP NTLM auth
8</keywords>
9</info>
10# Server-side
11<reply>
12
13<!-- Alternate the order that Basic and NTLM headers appear in responses to
14ensure that the order doesn't matter. -->
15
16<!-- First request has Basic auth, wrong password -->
17<data100>
18HTTP/1.1 401 Sorry wrong password
19Server: Microsoft-IIS/5.0
20Content-Type: text/html; charset=iso-8859-1
21Content-Length: 29
22WWW-Authenticate: NTLM
23WWW-Authenticate: Basic realm="testrealm"
24
25This is a bad password page!
26</data100>
27
28<!-- Second request has NTLM auth, right password -->
29<data200>
30HTTP/1.1 401 Need Basic or NTLM auth
31Server: Microsoft-IIS/5.0
32Content-Type: text/html; charset=iso-8859-1
33Content-Length: 27
34WWW-Authenticate: Basic realm="testrealm"
35WWW-Authenticate: NTLM
36
37This is not the real page!
38</data200>
39
40<data1201>
41HTTP/1.1 401 NTLM intermediate
42Server: Microsoft-IIS/5.0
43Content-Type: text/html; charset=iso-8859-1
44Content-Length: 33
45WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=
46
47This is still not the real page!
48</data1201>
49
50<data1202>
51HTTP/1.1 200 Things are fine in server land
52Server: Microsoft-IIS/5.0
53Content-Type: text/html; charset=iso-8859-1
54Content-Length: 32
55
56Finally, this is the real page!
57</data1202>
58
59<!-- Third request has Basic auth, wrong password -->
60<data300>
61HTTP/1.1 401 Sorry wrong password (2)
62Server: Microsoft-IIS/5.0
63Content-Type: text/html; charset=iso-8859-1
64Content-Length: 29
65WWW-Authenticate: NTLM
66WWW-Authenticate: Basic realm="testrealm"
67
68This is a bad password page!
69</data300>
70
71<!-- Fourth request has NTLM auth, wrong password -->
72<data400>
73HTTP/1.1 401 Need Basic or NTLM auth (2)
74Server: Microsoft-IIS/5.0
75Content-Type: text/html; charset=iso-8859-1
76Content-Length: 27
77WWW-Authenticate: Basic realm="testrealm"
78WWW-Authenticate: NTLM
79
80This is not the real page!
81</data400>
82
83<data1401>
84HTTP/1.1 401 NTLM intermediate (2)
85Server: Microsoft-IIS/5.0
86Content-Type: text/html; charset=iso-8859-1
87Content-Length: 33
88WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=
89
90This is still not the real page!
91</data1401>
92
93<data1402>
94HTTP/1.1 401 Sorry wrong password (3)
95Server: Microsoft-IIS/5.0
96Content-Type: text/html; charset=iso-8859-1
97Content-Length: 29
98WWW-Authenticate: NTLM
99WWW-Authenticate: Basic realm="testrealm"
100
101This is a bad password page!
102</data1402>
103
104<!-- Fifth request has NTLM auth, right password -->
105<data500>
106HTTP/1.1 401 Need Basic or NTLM auth (3)
107Server: Microsoft-IIS/5.0
108Content-Type: text/html; charset=iso-8859-1
109Content-Length: 27
110WWW-Authenticate: Basic realm="testrealm"
111WWW-Authenticate: NTLM
112
113This is not the real page!
114</data500>
115
116<data1501>
117HTTP/1.1 401 NTLM intermediate (3)
118Server: Microsoft-IIS/5.0
119Content-Type: text/html; charset=iso-8859-1
120Content-Length: 33
121WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=
122
123This is still not the real page!
124</data1501>
125
126<data1502>
127HTTP/1.1 200 Things are fine in server land (2)
128Server: Microsoft-IIS/5.0
129Content-Type: text/html; charset=iso-8859-1
130Content-Length: 32
131
132Finally, this is the real page!
133</data1502>
134
135<datacheck>
136HTTP/1.1 401 Sorry wrong password
137Server: Microsoft-IIS/5.0
138Content-Type: text/html; charset=iso-8859-1
139Content-Length: 29
140WWW-Authenticate: NTLM
141WWW-Authenticate: Basic realm="testrealm"
142
143This is a bad password page!
144HTTP/1.1 401 NTLM intermediate
145Server: Microsoft-IIS/5.0
146Content-Type: text/html; charset=iso-8859-1
147Content-Length: 33
148WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=
149
150HTTP/1.1 200 Things are fine in server land
151Server: Microsoft-IIS/5.0
152Content-Type: text/html; charset=iso-8859-1
153Content-Length: 32
154
155Finally, this is the real page!
156HTTP/1.1 401 Sorry wrong password (2)
157Server: Microsoft-IIS/5.0
158Content-Type: text/html; charset=iso-8859-1
159Content-Length: 29
160WWW-Authenticate: NTLM
161WWW-Authenticate: Basic realm="testrealm"
162
163This is a bad password page!
164HTTP/1.1 401 NTLM intermediate (2)
165Server: Microsoft-IIS/5.0
166Content-Type: text/html; charset=iso-8859-1
167Content-Length: 33
168WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=
169
170HTTP/1.1 401 Sorry wrong password (3)
171Server: Microsoft-IIS/5.0
172Content-Type: text/html; charset=iso-8859-1
173Content-Length: 29
174WWW-Authenticate: NTLM
175WWW-Authenticate: Basic realm="testrealm"
176
177This is a bad password page!
178HTTP/1.1 401 NTLM intermediate (3)
179Server: Microsoft-IIS/5.0
180Content-Type: text/html; charset=iso-8859-1
181Content-Length: 33
182WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=
183
184HTTP/1.1 200 Things are fine in server land (2)
185Server: Microsoft-IIS/5.0
186Content-Type: text/html; charset=iso-8859-1
187Content-Length: 32
188
189Finally, this is the real page!
190</datacheck>
191
192</reply>
193
194# Client-side
195<client>
196<features>
197NTLM
198SSL
199!SSPI
200</features>
201<server>
202http
203</server>
204<tool>
205libauthretry
206</tool>
207
208 <name>
209HTTP authorization retry (Basic switching to NTLM)
210 </name>
211 <setenv>
212# we force our own host name, in order to make the test machine independent
213CURL_GETHOSTNAME=curlhost
214# we try to use the LD_PRELOAD hack, if not a debug build
215LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
216 </setenv>
217 <command>
218http://%HOSTIP:%HTTPPORT/%TESTNUMBER basic ntlm
219</command>
220<precheck>
221chkhostname curlhost
222</precheck>
223</client>
224
225# Verify data after the test has been "shot"
226<verify>
227<protocol>
228GET /%TESTNUMBER0100 HTTP/1.1
229Host: %HOSTIP:%HTTPPORT
230Authorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz
231Accept: */*
232
233GET /%TESTNUMBER0200 HTTP/1.1
234Host: %HOSTIP:%HTTPPORT
235Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
236Accept: */*
237
238GET /%TESTNUMBER0200 HTTP/1.1
239Host: %HOSTIP:%HTTPPORT
240Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAAhoABAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyY3VybGhvc3Q=
241Accept: */*
242
243GET /%TESTNUMBER0300 HTTP/1.1
244Host: %HOSTIP:%HTTPPORT
245Authorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz
246Accept: */*
247
248GET /%TESTNUMBER0400 HTTP/1.1
249Host: %HOSTIP:%HTTPPORT
250Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
251Accept: */*
252
253GET /%TESTNUMBER0400 HTTP/1.1
254Host: %HOSTIP:%HTTPPORT
255Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAAhoABANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyY3VybGhvc3Q=
256Accept: */*
257
258GET /%TESTNUMBER0500 HTTP/1.1
259Host: %HOSTIP:%HTTPPORT
260Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
261Accept: */*
262
263GET /%TESTNUMBER0500 HTTP/1.1
264Host: %HOSTIP:%HTTPPORT
265Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAAhoABAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyY3VybGhvc3Q=
266Accept: */*
267
268</protocol>
269</verify>
270</testcase>
271