test2028 8.2 KB

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