test2029 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  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. <!-- Alternate the order that Basic and NTLM headers appear in responses to
  13. ensure that the order doesn't matter. -->
  14. <!-- First request has NTLM auth, wrong password -->
  15. <data100>
  16. HTTP/1.1 401 Need Basic 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: Basic realm="testrealm"
  22. This is not the real page!
  23. </data100>
  24. <data1101>
  25. HTTP/1.1 401 NTLM intermediate
  26. Server: Microsoft-IIS/5.0
  27. Content-Type: text/html; charset=iso-8859-1
  28. Content-Length: 33
  29. WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=
  30. This is still not the real page!
  31. </data1101>
  32. <data1102>
  33. HTTP/1.1 401 Sorry wrong password
  34. Server: Microsoft-IIS/5.0
  35. Content-Type: text/html; charset=iso-8859-1
  36. Content-Length: 29
  37. WWW-Authenticate: Basic realm="testrealm"
  38. WWW-Authenticate: NTLM
  39. This is a bad password page!
  40. </data1102>
  41. <!-- Second request has Basic auth, right password -->
  42. <data200>
  43. HTTP/1.1 200 Things are fine in server land
  44. Server: Microsoft-IIS/5.0
  45. Content-Type: text/html; charset=iso-8859-1
  46. Content-Length: 32
  47. Finally, this is the real page!
  48. </data200>
  49. <!-- Third request has NTLM auth, wrong password -->
  50. <data300>
  51. HTTP/1.1 401 Need Basic or NTLM auth (2)
  52. Server: Microsoft-IIS/5.0
  53. Content-Type: text/html; charset=iso-8859-1
  54. Content-Length: 27
  55. WWW-Authenticate: NTLM
  56. WWW-Authenticate: Basic realm="testrealm"
  57. This is not the real page!
  58. </data300>
  59. <data1301>
  60. HTTP/1.1 401 NTLM intermediate (2)
  61. Server: Microsoft-IIS/5.0
  62. Content-Type: text/html; charset=iso-8859-1
  63. Content-Length: 33
  64. WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=
  65. This is still not the real page!
  66. </data1301>
  67. <data1302>
  68. HTTP/1.1 401 Sorry wrong password (2)
  69. Server: Microsoft-IIS/5.0
  70. Content-Type: text/html; charset=iso-8859-1
  71. Content-Length: 29
  72. WWW-Authenticate: Basic realm="testrealm"
  73. WWW-Authenticate: NTLM
  74. This is a bad password page!
  75. </data1302>
  76. <!-- Fourth request has Basic auth, wrong password -->
  77. <data400>
  78. HTTP/1.1 401 Sorry wrong password (3)
  79. Server: Microsoft-IIS/5.0
  80. Content-Type: text/html; charset=iso-8859-1
  81. Content-Length: 29
  82. WWW-Authenticate: NTLM
  83. WWW-Authenticate: Basic realm="testrealm"
  84. This is a bad password page!
  85. </data400>
  86. <!-- Fifth request has Basic auth, right password -->
  87. <data500>
  88. HTTP/1.1 200 Things are fine in server land (2)
  89. Server: Microsoft-IIS/5.0
  90. Content-Type: text/html; charset=iso-8859-1
  91. Content-Length: 32
  92. Finally, this is the real page!
  93. </data500>
  94. <datacheck>
  95. HTTP/1.1 401 NTLM intermediate
  96. Server: Microsoft-IIS/5.0
  97. Content-Type: text/html; charset=iso-8859-1
  98. Content-Length: 33
  99. WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=
  100. HTTP/1.1 401 Sorry wrong password
  101. Server: Microsoft-IIS/5.0
  102. Content-Type: text/html; charset=iso-8859-1
  103. Content-Length: 29
  104. WWW-Authenticate: Basic realm="testrealm"
  105. WWW-Authenticate: NTLM
  106. This is a bad password page!
  107. HTTP/1.1 200 Things are fine in server land
  108. Server: Microsoft-IIS/5.0
  109. Content-Type: text/html; charset=iso-8859-1
  110. Content-Length: 32
  111. Finally, this is the real page!
  112. HTTP/1.1 401 NTLM intermediate (2)
  113. Server: Microsoft-IIS/5.0
  114. Content-Type: text/html; charset=iso-8859-1
  115. Content-Length: 33
  116. WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=
  117. HTTP/1.1 401 Sorry wrong password (2)
  118. Server: Microsoft-IIS/5.0
  119. Content-Type: text/html; charset=iso-8859-1
  120. Content-Length: 29
  121. WWW-Authenticate: Basic realm="testrealm"
  122. WWW-Authenticate: NTLM
  123. This is a bad password page!
  124. HTTP/1.1 401 Sorry wrong password (3)
  125. Server: Microsoft-IIS/5.0
  126. Content-Type: text/html; charset=iso-8859-1
  127. Content-Length: 29
  128. WWW-Authenticate: NTLM
  129. WWW-Authenticate: Basic realm="testrealm"
  130. This is a bad password page!
  131. HTTP/1.1 200 Things are fine in server land (2)
  132. Server: Microsoft-IIS/5.0
  133. Content-Type: text/html; charset=iso-8859-1
  134. Content-Length: 32
  135. Finally, this is the real page!
  136. </datacheck>
  137. </reply>
  138. # Client-side
  139. <client>
  140. <features>
  141. NTLM
  142. !SSPI
  143. </features>
  144. <server>
  145. http
  146. </server>
  147. <tool>
  148. libauthretry
  149. </tool>
  150. <name>
  151. HTTP authorization retry (NTLM switching to Basic)
  152. </name>
  153. <setenv>
  154. # we force our own host name, in order to make the test machine independent
  155. CURL_GETHOSTNAME=curlhost
  156. # we try to use the LD_PRELOAD hack, if not a debug build
  157. LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
  158. </setenv>
  159. <command>
  160. http://%HOSTIP:%HTTPPORT/2029 ntlm basic
  161. </command>
  162. <precheck>
  163. chkhostname curlhost
  164. </precheck>
  165. </client>
  166. # Verify data after the test has been "shot"
  167. <verify>
  168. <strip>
  169. ^User-Agent:.*
  170. </strip>
  171. <protocol>
  172. GET /20290100 HTTP/1.1
  173. Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
  174. Host: %HOSTIP:%HTTPPORT
  175. Accept: */*
  176. GET /20290100 HTTP/1.1
  177. Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyY3VybGhvc3Q=
  178. Host: %HOSTIP:%HTTPPORT
  179. Accept: */*
  180. GET /20290200 HTTP/1.1
  181. Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=
  182. Host: %HOSTIP:%HTTPPORT
  183. Accept: */*
  184. GET /20290300 HTTP/1.1
  185. Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
  186. Host: %HOSTIP:%HTTPPORT
  187. Accept: */*
  188. GET /20290300 HTTP/1.1
  189. Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyY3VybGhvc3Q=
  190. Host: %HOSTIP:%HTTPPORT
  191. Accept: */*
  192. GET /20290400 HTTP/1.1
  193. Authorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz
  194. Host: %HOSTIP:%HTTPPORT
  195. Accept: */*
  196. GET /20290500 HTTP/1.1
  197. Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=
  198. Host: %HOSTIP:%HTTPPORT
  199. Accept: */*
  200. </protocol>
  201. </verify>
  202. </testcase>