42866a31b5aac5c30f0edba54e1b519e8f6ae27c
[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 !SSPI
172 </features>
173 <server>
174 http
175 </server>
176 <tool>
177 libauthretry
178 </tool>
179
180  <name>
181 HTTP authorization retry (NTLM switching to Basic)
182  </name>
183  <setenv>
184 # we force our own host name, in order to make the test machine independent
185 CURL_GETHOSTNAME=curlhost
186 # we try to use the LD_PRELOAD hack, if not a debug build
187 LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
188  </setenv>
189  <command>
190 http://%HOSTIP:%HTTPPORT/2029 ntlm basic
191 </command>
192 <precheck>
193 chkhostname curlhost
194 </precheck>
195 </client>
196
197 # Verify data after the test has been "shot"
198 <verify>
199 <strip>
200 ^User-Agent:.*
201 </strip>
202 <protocol>
203 GET /20290100 HTTP/1.1\r
204 Host: %HOSTIP:%HTTPPORT\r
205 Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=\r
206 Accept: */*\r
207 \r
208 GET /20290100 HTTP/1.1\r
209 Host: %HOSTIP:%HTTPPORT\r
210 Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyY3VybGhvc3Q=\r
211 Accept: */*\r
212 \r
213 GET /20290200 HTTP/1.1\r
214 Host: %HOSTIP:%HTTPPORT\r
215 Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=\r
216 Accept: */*\r
217 \r
218 GET /20290300 HTTP/1.1\r
219 Host: %HOSTIP:%HTTPPORT\r
220 Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=\r
221 Accept: */*\r
222 \r
223 GET /20290300 HTTP/1.1\r
224 Host: %HOSTIP:%HTTPPORT\r
225 Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyY3VybGhvc3Q=\r
226 Accept: */*\r
227 \r
228 GET /20290400 HTTP/1.1\r
229 Host: %HOSTIP:%HTTPPORT\r
230 Authorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz\r
231 Accept: */*\r
232 \r
233 GET /20290500 HTTP/1.1\r
234 Host: %HOSTIP:%HTTPPORT\r
235 Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=\r
236 Accept: */*\r
237 \r
238 </protocol>
239 </verify>
240 </testcase>