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 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: Basic realm="testrealm" 24 25 This is not the real page! 26 </data100> 27 28 <data1101> 29 HTTP/1.1 401 NTLM intermediate 30 Server: Microsoft-IIS/5.0 31 Content-Type: text/html; charset=iso-8859-1 32 Content-Length: 33 33 WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= 34 35 This is still not the real page! 36 </data1101> 37 38 <data1102> 39 HTTP/1.1 401 Sorry wrong password 40 Server: Microsoft-IIS/5.0 41 Content-Type: text/html; charset=iso-8859-1 42 Content-Length: 29 43 WWW-Authenticate: Basic realm="testrealm" 44 WWW-Authenticate: NTLM 45 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 52 Server: Microsoft-IIS/5.0 53 Content-Type: text/html; charset=iso-8859-1 54 Content-Length: 32 55 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) 62 Server: Microsoft-IIS/5.0 63 Content-Type: text/html; charset=iso-8859-1 64 Content-Length: 27 65 WWW-Authenticate: NTLM 66 WWW-Authenticate: Basic realm="testrealm" 67 68 This is not the real page! 69 </data300> 70 71 <data1301> 72 HTTP/1.1 401 NTLM intermediate (2) 73 Server: Microsoft-IIS/5.0 74 Content-Type: text/html; charset=iso-8859-1 75 Content-Length: 33 76 WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= 77 78 This is still not the real page! 79 </data1301> 80 81 <data1302> 82 HTTP/1.1 401 Sorry wrong password (2) 83 Server: Microsoft-IIS/5.0 84 Content-Type: text/html; charset=iso-8859-1 85 Content-Length: 29 86 WWW-Authenticate: Basic realm="testrealm" 87 WWW-Authenticate: NTLM 88 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) 95 Server: Microsoft-IIS/5.0 96 Content-Type: text/html; charset=iso-8859-1 97 Content-Length: 29 98 WWW-Authenticate: NTLM 99 WWW-Authenticate: Basic realm="testrealm" 100 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) 107 Server: Microsoft-IIS/5.0 108 Content-Type: text/html; charset=iso-8859-1 109 Content-Length: 32 110 111 Finally, this is the real page! 112 </data500> 113 114 <datacheck> 115 HTTP/1.1 401 NTLM intermediate 116 Server: Microsoft-IIS/5.0 117 Content-Type: text/html; charset=iso-8859-1 118 Content-Length: 33 119 WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= 120 121 HTTP/1.1 401 Sorry wrong password 122 Server: Microsoft-IIS/5.0 123 Content-Type: text/html; charset=iso-8859-1 124 Content-Length: 29 125 WWW-Authenticate: Basic realm="testrealm" 126 WWW-Authenticate: NTLM 127 128 This is a bad password page! 129 HTTP/1.1 200 Things are fine in server land 130 Server: Microsoft-IIS/5.0 131 Content-Type: text/html; charset=iso-8859-1 132 Content-Length: 32 133 134 Finally, this is the real page! 135 HTTP/1.1 401 NTLM intermediate (2) 136 Server: Microsoft-IIS/5.0 137 Content-Type: text/html; charset=iso-8859-1 138 Content-Length: 33 139 WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= 140 141 HTTP/1.1 401 Sorry wrong password (2) 142 Server: Microsoft-IIS/5.0 143 Content-Type: text/html; charset=iso-8859-1 144 Content-Length: 29 145 WWW-Authenticate: Basic realm="testrealm" 146 WWW-Authenticate: NTLM 147 148 This is a bad password page! 149 HTTP/1.1 401 Sorry wrong password (3) 150 Server: Microsoft-IIS/5.0 151 Content-Type: text/html; charset=iso-8859-1 152 Content-Length: 29 153 WWW-Authenticate: NTLM 154 WWW-Authenticate: Basic realm="testrealm" 155 156 This is a bad password page! 157 HTTP/1.1 200 Things are fine in server land (2) 158 Server: Microsoft-IIS/5.0 159 Content-Type: text/html; charset=iso-8859-1 160 Content-Length: 32 161 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 204 Host: %HOSTIP:%HTTPPORT 205 Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= 206 Accept: */* 207 208 GET /20290100 HTTP/1.1 209 Host: %HOSTIP:%HTTPPORT 210 Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyY3VybGhvc3Q= 211 Accept: */* 212 213 GET /20290200 HTTP/1.1 214 Host: %HOSTIP:%HTTPPORT 215 Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M= 216 Accept: */* 217 218 GET /20290300 HTTP/1.1 219 Host: %HOSTIP:%HTTPPORT 220 Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= 221 Accept: */* 222 223 GET /20290300 HTTP/1.1 224 Host: %HOSTIP:%HTTPPORT 225 Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyY3VybGhvc3Q= 226 Accept: */* 227 228 GET /20290400 HTTP/1.1 229 Host: %HOSTIP:%HTTPPORT 230 Authorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz 231 Accept: */* 232 233 GET /20290500 HTTP/1.1 234 Host: %HOSTIP:%HTTPPORT 235 Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M= 236 Accept: */* 237 238 </protocol> 239 </verify> 240 </testcase> 241