1<testcase>
2<info>
3<keywords>
4HTTP
5HTTP GET
6HTTP Basic auth
7</keywords>
8</info>
9# Server-side
10<reply>
11
12<!-- First request has Basic auth, wrong password -->
13<data100>
14HTTP/1.1 401 Sorry wrong password
15Server: Microsoft-IIS/5.0
16Content-Type: text/html; charset=iso-8859-1
17Content-Length: 29
18WWW-Authenticate: Basic realm="testrealm"
19
20This is a bad password page!
21</data100>
22
23<!-- Second request has Basic auth, right password -->
24<data200>
25HTTP/1.1 200 Things are fine in server land
26Server: Microsoft-IIS/5.0
27Content-Type: text/html; charset=iso-8859-1
28Content-Length: 32
29
30Finally, this is the real page!
31</data200>
32
33<!-- Third request has Basic auth, wrong password -->
34<data300>
35HTTP/1.1 401 Sorry wrong password (2)
36Server: Microsoft-IIS/5.0
37Content-Type: text/html; charset=iso-8859-1
38Content-Length: 29
39WWW-Authenticate: Basic realm="testrealm"
40
41This is a bad password page!
42</data300>
43
44<!-- Fourth request has Basic auth, wrong password -->
45<data400>
46HTTP/1.1 401 Sorry wrong password (3)
47Server: Microsoft-IIS/5.0
48Content-Type: text/html; charset=iso-8859-1
49Content-Length: 29
50WWW-Authenticate: Basic realm="testrealm"
51
52This is a bad password page!
53</data400>
54
55<!-- Fifth request has Basic auth, right password -->
56<data500>
57HTTP/1.1 200 Things are fine in server land (2)
58Server: Microsoft-IIS/5.0
59Content-Type: text/html; charset=iso-8859-1
60Content-Length: 32
61
62Finally, this is the real page!
63</data500>
64
65<datacheck>
66HTTP/1.1 401 Sorry wrong password
67Server: Microsoft-IIS/5.0
68Content-Type: text/html; charset=iso-8859-1
69Content-Length: 29
70WWW-Authenticate: Basic realm="testrealm"
71
72This is a bad password page!
73HTTP/1.1 200 Things are fine in server land
74Server: Microsoft-IIS/5.0
75Content-Type: text/html; charset=iso-8859-1
76Content-Length: 32
77
78Finally, this is the real page!
79HTTP/1.1 401 Sorry wrong password (2)
80Server: Microsoft-IIS/5.0
81Content-Type: text/html; charset=iso-8859-1
82Content-Length: 29
83WWW-Authenticate: Basic realm="testrealm"
84
85This is a bad password page!
86HTTP/1.1 401 Sorry wrong password (3)
87Server: Microsoft-IIS/5.0
88Content-Type: text/html; charset=iso-8859-1
89Content-Length: 29
90WWW-Authenticate: Basic realm="testrealm"
91
92This is a bad password page!
93HTTP/1.1 200 Things are fine in server land (2)
94Server: Microsoft-IIS/5.0
95Content-Type: text/html; charset=iso-8859-1
96Content-Length: 32
97
98Finally, this is the real page!
99</datacheck>
100
101</reply>
102
103# Client-side
104<client>
105<server>
106http
107</server>
108<tool>
109libauthretry
110</tool>
111
112 <name>
113HTTP authorization retry (Basic)
114 </name>
115 <setenv>
116# we force our own host name, in order to make the test machine independent
117CURL_GETHOSTNAME=curlhost
118# we try to use the LD_PRELOAD hack, if not a debug build
119LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
120 </setenv>
121 <command>
122http://%HOSTIP:%HTTPPORT/2023 basic basic
123</command>
124<precheck>
125chkhostname curlhost
126</precheck>
127</client>
128
129# Verify data after the test has been "shot"
130<verify>
131<strip>
132^User-Agent:.*
133</strip>
134<protocol>
135GET /20230100 HTTP/1.1
136Authorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz
137Host: %HOSTIP:%HTTPPORT
138Accept: */*
139
140GET /20230200 HTTP/1.1
141Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=
142Host: %HOSTIP:%HTTPPORT
143Accept: */*
144
145GET /20230300 HTTP/1.1
146Authorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz
147Host: %HOSTIP:%HTTPPORT
148Accept: */*
149
150GET /20230400 HTTP/1.1
151Authorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz
152Host: %HOSTIP:%HTTPPORT
153Accept: */*
154
155GET /20230500 HTTP/1.1
156Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=
157Host: %HOSTIP:%HTTPPORT
158Accept: */*
159
160</protocol>
161</verify>
162</testcase>
163