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