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 <!-- First request has Digest auth, wrong password --> 17 <data100> 18 HTTP/1.1 401 Need Digest or NTLM auth 19 Server: Microsoft-IIS/5.0 20 Content-Type: text/html; charset=iso-8859-1 21 Content-Length: 27 22 WWW-Authenticate: NTLM 23 WWW-Authenticate: Digest realm="testrealm", nonce="1" 24 25 This is not the real page! 26 </data100> 27 28 <data1100> 29 HTTP/1.1 401 Sorry wrong password 30 Server: Microsoft-IIS/5.0 31 Content-Type: text/html; charset=iso-8859-1 32 Content-Length: 29 33 WWW-Authenticate: Digest realm="testrealm", nonce="2" 34 WWW-Authenticate: NTLM 35 36 This is a bad password page! 37 </data1100> 38 39 <!-- Second request has NTLM auth, right password --> 40 <data200> 41 HTTP/1.1 401 Need Digest or NTLM auth (2) 42 Server: Microsoft-IIS/5.0 43 Content-Type: text/html; charset=iso-8859-1 44 Content-Length: 27 45 WWW-Authenticate: NTLM 46 WWW-Authenticate: Digest realm="testrealm", nonce="3" 47 48 This is not the real page! 49 </data200> 50 51 <data1201> 52 HTTP/1.1 401 NTLM intermediate 53 Server: Microsoft-IIS/5.0 54 Content-Type: text/html; charset=iso-8859-1 55 Content-Length: 33 56 WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= 57 58 This is still not the real page! 59 </data1201> 60 61 <data1202> 62 HTTP/1.1 200 Things are fine in server land 63 Server: Microsoft-IIS/5.0 64 Content-Type: text/html; charset=iso-8859-1 65 Content-Length: 32 66 67 Finally, this is the real page! 68 </data1202> 69 70 <!-- Third request has Digest auth, wrong password --> 71 <data300> 72 HTTP/1.1 401 Need Digest or NTLM auth (3) 73 Server: Microsoft-IIS/5.0 74 Content-Type: text/html; charset=iso-8859-1 75 Content-Length: 27 76 WWW-Authenticate: Digest realm="testrealm", nonce="4" 77 WWW-Authenticate: NTLM 78 79 This is not the real page! 80 </data300> 81 82 <data1300> 83 HTTP/1.1 401 Sorry wrong password (2) 84 Server: Microsoft-IIS/5.0 85 Content-Type: text/html; charset=iso-8859-1 86 Content-Length: 29 87 WWW-Authenticate: NTLM 88 WWW-Authenticate: Digest realm="testrealm", nonce="5" 89 90 This is a bad password page! 91 </data1300> 92 93 <!-- Fourth request has NTLM auth, wrong password --> 94 <data400> 95 HTTP/1.1 401 Need Digest or NTLM auth (4) 96 Server: Microsoft-IIS/5.0 97 Content-Type: text/html; charset=iso-8859-1 98 Content-Length: 27 99 WWW-Authenticate: Digest realm="testrealm", nonce="6" 100 WWW-Authenticate: NTLM 101 102 This is not the real page! 103 </data400> 104 105 <data1401> 106 HTTP/1.1 401 NTLM intermediate (2) 107 Server: Microsoft-IIS/5.0 108 Content-Type: text/html; charset=iso-8859-1 109 Content-Length: 33 110 WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= 111 112 This is still not the real page! 113 </data1401> 114 115 <data1402> 116 HTTP/1.1 401 Sorry wrong password (3) 117 Server: Microsoft-IIS/5.0 118 Content-Type: text/html; charset=iso-8859-1 119 Content-Length: 29 120 WWW-Authenticate: NTLM 121 WWW-Authenticate: Digest realm="testrealm", nonce="7" 122 123 This is a bad password page! 124 </data1402> 125 126 <!-- Fifth request has NTLM auth, right password --> 127 <data500> 128 HTTP/1.1 401 Need Digest or NTLM auth (5) 129 Server: Microsoft-IIS/5.0 130 Content-Type: text/html; charset=iso-8859-1 131 Content-Length: 27 132 WWW-Authenticate: Digest realm="testrealm", nonce="8" 133 WWW-Authenticate: NTLM 134 135 This is not the real page! 136 </data500> 137 138 <data1501> 139 HTTP/1.1 401 NTLM intermediate (3) 140 Server: Microsoft-IIS/5.0 141 Content-Type: text/html; charset=iso-8859-1 142 Content-Length: 33 143 WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= 144 145 This is still not the real page! 146 </data1501> 147 148 <data1502> 149 HTTP/1.1 200 Things are fine in server land (2) 150 Server: Microsoft-IIS/5.0 151 Content-Type: text/html; charset=iso-8859-1 152 Content-Length: 32 153 154 Finally, this is the real page! 155 </data1502> 156 157 <datacheck> 158 HTTP/1.1 401 Need Digest or NTLM auth 159 Server: Microsoft-IIS/5.0 160 Content-Type: text/html; charset=iso-8859-1 161 Content-Length: 27 162 WWW-Authenticate: NTLM 163 WWW-Authenticate: Digest realm="testrealm", nonce="1" 164 165 HTTP/1.1 401 Sorry wrong password 166 Server: Microsoft-IIS/5.0 167 Content-Type: text/html; charset=iso-8859-1 168 Content-Length: 29 169 WWW-Authenticate: Digest realm="testrealm", nonce="2" 170 WWW-Authenticate: NTLM 171 172 This is a bad password page! 173 HTTP/1.1 401 NTLM intermediate 174 Server: Microsoft-IIS/5.0 175 Content-Type: text/html; charset=iso-8859-1 176 Content-Length: 33 177 WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= 178 179 HTTP/1.1 200 Things are fine in server land 180 Server: Microsoft-IIS/5.0 181 Content-Type: text/html; charset=iso-8859-1 182 Content-Length: 32 183 184 Finally, this is the real page! 185 HTTP/1.1 401 Need Digest or NTLM auth (3) 186 Server: Microsoft-IIS/5.0 187 Content-Type: text/html; charset=iso-8859-1 188 Content-Length: 27 189 WWW-Authenticate: Digest realm="testrealm", nonce="4" 190 WWW-Authenticate: NTLM 191 192 HTTP/1.1 401 Sorry wrong password (2) 193 Server: Microsoft-IIS/5.0 194 Content-Type: text/html; charset=iso-8859-1 195 Content-Length: 29 196 WWW-Authenticate: NTLM 197 WWW-Authenticate: Digest realm="testrealm", nonce="5" 198 199 This is a bad password page! 200 HTTP/1.1 401 NTLM intermediate (2) 201 Server: Microsoft-IIS/5.0 202 Content-Type: text/html; charset=iso-8859-1 203 Content-Length: 33 204 WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= 205 206 HTTP/1.1 401 Sorry wrong password (3) 207 Server: Microsoft-IIS/5.0 208 Content-Type: text/html; charset=iso-8859-1 209 Content-Length: 29 210 WWW-Authenticate: NTLM 211 WWW-Authenticate: Digest realm="testrealm", nonce="7" 212 213 This is a bad password page! 214 HTTP/1.1 401 NTLM intermediate (3) 215 Server: Microsoft-IIS/5.0 216 Content-Type: text/html; charset=iso-8859-1 217 Content-Length: 33 218 WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= 219 220 HTTP/1.1 200 Things are fine in server land (2) 221 Server: Microsoft-IIS/5.0 222 Content-Type: text/html; charset=iso-8859-1 223 Content-Length: 32 224 225 Finally, this is the real page! 226 </datacheck> 227 228 </reply> 229 230 # Client-side 231 <client> 232 <features> 233 NTLM 234 !SSPI 235 </features> 236 <server> 237 http 238 </server> 239 <tool> 240 libauthretry 241 </tool> 242 243 <name> 244 HTTP authorization retry (Digest switching to NTLM) 245 </name> 246 <setenv> 247 # we force our own host name, in order to make the test machine independent 248 CURL_GETHOSTNAME=curlhost 249 # we try to use the LD_PRELOAD hack, if not a debug build 250 LD_PRELOAD=%PWD/libtest/.libs/libhostname.so 251 </setenv> 252 <command> 253 http://%HOSTIP:%HTTPPORT/2028 digest ntlm 254 </command> 255 <precheck> 256 chkhostname curlhost 257 </precheck> 258 </client> 259 260 # Verify data after the test has been "shot" 261 <verify> 262 <strip> 263 ^User-Agent:.* 264 </strip> 265 <protocol> 266 GET /20280100 HTTP/1.1 267 Host: %HOSTIP:%HTTPPORT 268 Accept: */* 269 270 GET /20280100 HTTP/1.1 271 Host: %HOSTIP:%HTTPPORT 272 Authorization: Digest username="testuser", realm="testrealm", nonce="1", uri="/20280100", response="53c80666f5e3a4a55f92a66aaf0078bb" 273 Accept: */* 274 275 GET /20280200 HTTP/1.1 276 Host: %HOSTIP:%HTTPPORT 277 Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= 278 Accept: */* 279 280 GET /20280200 HTTP/1.1 281 Host: %HOSTIP:%HTTPPORT 282 Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyY3VybGhvc3Q= 283 Accept: */* 284 285 GET /20280300 HTTP/1.1 286 Host: %HOSTIP:%HTTPPORT 287 Accept: */* 288 289 GET /20280300 HTTP/1.1 290 Host: %HOSTIP:%HTTPPORT 291 Authorization: Digest username="testuser", realm="testrealm", nonce="4", uri="/20280300", response="1aa5d90da9803ca12d04b24e0f19476e" 292 Accept: */* 293 294 GET /20280400 HTTP/1.1 295 Host: %HOSTIP:%HTTPPORT 296 Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= 297 Accept: */* 298 299 GET /20280400 HTTP/1.1 300 Host: %HOSTIP:%HTTPPORT 301 Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyY3VybGhvc3Q= 302 Accept: */* 303 304 GET /20280500 HTTP/1.1 305 Host: %HOSTIP:%HTTPPORT 306 Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= 307 Accept: */* 308 309 GET /20280500 HTTP/1.1 310 Host: %HOSTIP:%HTTPPORT 311 Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyY3VybGhvc3Q= 312 Accept: */* 313 314 </protocol> 315 </verify> 316 </testcase> 317