test2023 (3341B)
1 <testcase> 2 <info> 3 <keywords> 4 HTTP 5 HTTP GET 6 HTTP Basic auth 7 </keywords> 8 </info> 9 # Server-side 10 <reply> 11 12 <!-- First request has Basic auth, wrong password --> 13 <data100> 14 HTTP/1.1 401 Sorry wrong password 15 Server: Microsoft-IIS/5.0 16 Content-Type: text/html; charset=iso-8859-1 17 Content-Length: 29 18 WWW-Authenticate: Basic realm="testrealm" 19 20 This is a bad password page! 21 </data100> 22 23 <!-- Second request has Basic auth, right password --> 24 <data200> 25 HTTP/1.1 200 Things are fine in server land 26 Server: Microsoft-IIS/5.0 27 Content-Type: text/html; charset=iso-8859-1 28 Content-Length: 32 29 30 Finally, this is the real page! 31 </data200> 32 33 <!-- Third request has Basic auth, wrong password --> 34 <data300> 35 HTTP/1.1 401 Sorry wrong password (2) 36 Server: Microsoft-IIS/5.0 37 Content-Type: text/html; charset=iso-8859-1 38 Content-Length: 29 39 WWW-Authenticate: Basic realm="testrealm" 40 41 This is a bad password page! 42 </data300> 43 44 <!-- Fourth request has Basic auth, wrong password --> 45 <data400> 46 HTTP/1.1 401 Sorry wrong password (3) 47 Server: Microsoft-IIS/5.0 48 Content-Type: text/html; charset=iso-8859-1 49 Content-Length: 29 50 WWW-Authenticate: Basic realm="testrealm" 51 52 This is a bad password page! 53 </data400> 54 55 <!-- Fifth request has Basic auth, right password --> 56 <data500> 57 HTTP/1.1 200 Things are fine in server land (2) 58 Server: Microsoft-IIS/5.0 59 Content-Type: text/html; charset=iso-8859-1 60 Content-Length: 32 61 62 Finally, this is the real page! 63 </data500> 64 65 <datacheck> 66 HTTP/1.1 401 Sorry wrong password 67 Server: Microsoft-IIS/5.0 68 Content-Type: text/html; charset=iso-8859-1 69 Content-Length: 29 70 WWW-Authenticate: Basic realm="testrealm" 71 72 This is a bad password page! 73 HTTP/1.1 200 Things are fine in server land 74 Server: Microsoft-IIS/5.0 75 Content-Type: text/html; charset=iso-8859-1 76 Content-Length: 32 77 78 Finally, this is the real page! 79 HTTP/1.1 401 Sorry wrong password (2) 80 Server: Microsoft-IIS/5.0 81 Content-Type: text/html; charset=iso-8859-1 82 Content-Length: 29 83 WWW-Authenticate: Basic realm="testrealm" 84 85 This is a bad password page! 86 HTTP/1.1 401 Sorry wrong password (3) 87 Server: Microsoft-IIS/5.0 88 Content-Type: text/html; charset=iso-8859-1 89 Content-Length: 29 90 WWW-Authenticate: Basic realm="testrealm" 91 92 This is a bad password page! 93 HTTP/1.1 200 Things are fine in server land (2) 94 Server: Microsoft-IIS/5.0 95 Content-Type: text/html; charset=iso-8859-1 96 Content-Length: 32 97 98 Finally, this is the real page! 99 </datacheck> 100 101 </reply> 102 103 # Client-side 104 <client> 105 <server> 106 http 107 </server> 108 <tool> 109 lib2023 110 </tool> 111 112 <name> 113 HTTP authorization retry (Basic) 114 </name> 115 <command> 116 http://%HOSTIP:%HTTPPORT/%TESTNUMBER basic basic 117 </command> 118 </client> 119 120 # Verify data after the test has been "shot" 121 <verify> 122 <protocol> 123 GET /%TESTNUMBER0100 HTTP/1.1 124 Host: %HOSTIP:%HTTPPORT 125 Authorization: Basic %b64[testuser:wrongpass]b64% 126 Accept: */* 127 128 GET /%TESTNUMBER0200 HTTP/1.1 129 Host: %HOSTIP:%HTTPPORT 130 Authorization: Basic %b64[testuser:testpass]b64% 131 Accept: */* 132 133 GET /%TESTNUMBER0300 HTTP/1.1 134 Host: %HOSTIP:%HTTPPORT 135 Authorization: Basic %b64[testuser:wrongpass]b64% 136 Accept: */* 137 138 GET /%TESTNUMBER0400 HTTP/1.1 139 Host: %HOSTIP:%HTTPPORT 140 Authorization: Basic %b64[testuser:wrongpass]b64% 141 Accept: */* 142 143 GET /%TESTNUMBER0500 HTTP/1.1 144 Host: %HOSTIP:%HTTPPORT 145 Authorization: Basic %b64[testuser:testpass]b64% 146 Accept: */* 147 148 </protocol> 149 </verify> 150 </testcase>