7b8a5e2c79ec202a1f056aa3b589c3987360f12b
[platform/upstream/curl.git] / tests / data / test2029
1 <testcase>
2 <info>
3 <keywords>
4 HTTP
5 HTTP GET
6 HTTP Basic auth
7 HTTP 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
14 ensure that the order doesn't matter. -->
15
16 <!-- First request has NTLM auth, wrong password -->
17 <data100>
18 HTTP/1.1 401 Need Basic or NTLM auth\r
19 Server: Microsoft-IIS/5.0\r
20 Content-Type: text/html; charset=iso-8859-1\r
21 Content-Length: 27\r
22 WWW-Authenticate: NTLM\r
23 WWW-Authenticate: Basic realm="testrealm"\r
24 \r
25 This is not the real page!
26 </data100>
27
28 <data1101>
29 HTTP/1.1 401 NTLM intermediate\r
30 Server: Microsoft-IIS/5.0\r
31 Content-Type: text/html; charset=iso-8859-1\r
32 Content-Length: 33\r
33 WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=\r
34 \r
35 This is still not the real page!
36 </data1101>
37
38 <data1102>
39 HTTP/1.1 401 Sorry wrong password\r
40 Server: Microsoft-IIS/5.0\r
41 Content-Type: text/html; charset=iso-8859-1\r
42 Content-Length: 29\r
43 WWW-Authenticate: Basic realm="testrealm"\r
44 WWW-Authenticate: NTLM\r
45 \r
46 This is a bad password page!
47 </data1102>
48
49 <!-- Second request has Basic auth, right password -->
50 <data200>
51 HTTP/1.1 200 Things are fine in server land\r
52 Server: Microsoft-IIS/5.0\r
53 Content-Type: text/html; charset=iso-8859-1\r
54 Content-Length: 32\r
55 \r
56 Finally, this is the real page!
57 </data200>
58
59 <!-- Third request has NTLM auth, wrong password -->
60 <data300>
61 HTTP/1.1 401 Need Basic or NTLM auth (2)\r
62 Server: Microsoft-IIS/5.0\r
63 Content-Type: text/html; charset=iso-8859-1\r
64 Content-Length: 27\r
65 WWW-Authenticate: NTLM\r
66 WWW-Authenticate: Basic realm="testrealm"\r
67 \r
68 This is not the real page!
69 </data300>
70
71 <data1301>
72 HTTP/1.1 401 NTLM intermediate (2)\r
73 Server: Microsoft-IIS/5.0\r
74 Content-Type: text/html; charset=iso-8859-1\r
75 Content-Length: 33\r
76 WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=\r
77 \r
78 This is still not the real page!
79 </data1301>
80
81 <data1302>
82 HTTP/1.1 401 Sorry wrong password (2)\r
83 Server: Microsoft-IIS/5.0\r
84 Content-Type: text/html; charset=iso-8859-1\r
85 Content-Length: 29\r
86 WWW-Authenticate: Basic realm="testrealm"\r
87 WWW-Authenticate: NTLM\r
88 \r
89 This is a bad password page!
90 </data1302>
91
92 <!-- Fourth request has Basic auth, wrong password -->
93 <data400>
94 HTTP/1.1 401 Sorry wrong password (3)\r
95 Server: Microsoft-IIS/5.0\r
96 Content-Type: text/html; charset=iso-8859-1\r
97 Content-Length: 29\r
98 WWW-Authenticate: NTLM\r
99 WWW-Authenticate: Basic realm="testrealm"\r
100 \r
101 This is a bad password page!
102 </data400>
103
104 <!-- Fifth request has Basic auth, right password -->
105 <data500>
106 HTTP/1.1 200 Things are fine in server land (2)\r
107 Server: Microsoft-IIS/5.0\r
108 Content-Type: text/html; charset=iso-8859-1\r
109 Content-Length: 32\r
110 \r
111 Finally, this is the real page!
112 </data500>
113
114 <datacheck>
115 HTTP/1.1 401 NTLM intermediate\r
116 Server: Microsoft-IIS/5.0\r
117 Content-Type: text/html; charset=iso-8859-1\r
118 Content-Length: 33\r
119 WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=\r
120 \r
121 HTTP/1.1 401 Sorry wrong password\r
122 Server: Microsoft-IIS/5.0\r
123 Content-Type: text/html; charset=iso-8859-1\r
124 Content-Length: 29\r
125 WWW-Authenticate: Basic realm="testrealm"\r
126 WWW-Authenticate: NTLM\r
127 \r
128 This is a bad password page!
129 HTTP/1.1 200 Things are fine in server land\r
130 Server: Microsoft-IIS/5.0\r
131 Content-Type: text/html; charset=iso-8859-1\r
132 Content-Length: 32\r
133 \r
134 Finally, this is the real page!
135 HTTP/1.1 401 NTLM intermediate (2)\r
136 Server: Microsoft-IIS/5.0\r
137 Content-Type: text/html; charset=iso-8859-1\r
138 Content-Length: 33\r
139 WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=\r
140 \r
141 HTTP/1.1 401 Sorry wrong password (2)\r
142 Server: Microsoft-IIS/5.0\r
143 Content-Type: text/html; charset=iso-8859-1\r
144 Content-Length: 29\r
145 WWW-Authenticate: Basic realm="testrealm"\r
146 WWW-Authenticate: NTLM\r
147 \r
148 This is a bad password page!
149 HTTP/1.1 401 Sorry wrong password (3)\r
150 Server: Microsoft-IIS/5.0\r
151 Content-Type: text/html; charset=iso-8859-1\r
152 Content-Length: 29\r
153 WWW-Authenticate: NTLM\r
154 WWW-Authenticate: Basic realm="testrealm"\r
155 \r
156 This is a bad password page!
157 HTTP/1.1 200 Things are fine in server land (2)\r
158 Server: Microsoft-IIS/5.0\r
159 Content-Type: text/html; charset=iso-8859-1\r
160 Content-Length: 32\r
161 \r
162 Finally, this is the real page!
163 </datacheck>
164
165 </reply>
166
167 # Client-side
168 <client>
169 <features>
170 NTLM
171 </features>
172 <server>
173 http
174 </server>
175 <tool>
176 libauthretry
177 </tool>
178
179  <name>
180 HTTP authorization retry (NTLM switching to Basic)
181  </name>
182  <setenv>
183 # we force our own host name, in order to make the test machine independent
184 CURL_GETHOSTNAME=curlhost
185 # we try to use the LD_PRELOAD hack, if not a debug build
186 LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
187  </setenv>
188  <command>
189 http://%HOSTIP:%HTTPPORT/2029 ntlm basic
190 </command>
191 <precheck>
192 chkhostname curlhost
193 </precheck>
194 </client>
195
196 # Verify data after the test has been "shot"
197 <verify>
198 <strip>
199 ^User-Agent:.*
200 </strip>
201 <protocol>
202 GET /20290100 HTTP/1.1\r
203 Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=\r
204 Host: %HOSTIP:%HTTPPORT\r
205 Accept: */*\r
206 \r
207 GET /20290100 HTTP/1.1\r
208 Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyY3VybGhvc3Q=\r
209 Host: %HOSTIP:%HTTPPORT\r
210 Accept: */*\r
211 \r
212 GET /20290200 HTTP/1.1\r
213 Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=\r
214 Host: %HOSTIP:%HTTPPORT\r
215 Accept: */*\r
216 \r
217 GET /20290300 HTTP/1.1\r
218 Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=\r
219 Host: %HOSTIP:%HTTPPORT\r
220 Accept: */*\r
221 \r
222 GET /20290300 HTTP/1.1\r
223 Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyY3VybGhvc3Q=\r
224 Host: %HOSTIP:%HTTPPORT\r
225 Accept: */*\r
226 \r
227 GET /20290400 HTTP/1.1\r
228 Authorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz\r
229 Host: %HOSTIP:%HTTPPORT\r
230 Accept: */*\r
231 \r
232 GET /20290500 HTTP/1.1\r
233 Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=\r
234 Host: %HOSTIP:%HTTPPORT\r
235 Accept: */*\r
236 \r
237 </protocol>
238 </verify>
239 </testcase>