xref: /curl/tests/data/test2023 (revision 09437d8c)
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<command>
116http://%HOSTIP:%HTTPPORT/%TESTNUMBER basic basic
117</command>
118</client>
119
120# Verify data after the test has been "shot"
121<verify>
122<protocol>
123GET /%TESTNUMBER0100 HTTP/1.1
124Host: %HOSTIP:%HTTPPORT
125Authorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz
126Accept: */*
127
128GET /%TESTNUMBER0200 HTTP/1.1
129Host: %HOSTIP:%HTTPPORT
130Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=
131Accept: */*
132
133GET /%TESTNUMBER0300 HTTP/1.1
134Host: %HOSTIP:%HTTPPORT
135Authorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz
136Accept: */*
137
138GET /%TESTNUMBER0400 HTTP/1.1
139Host: %HOSTIP:%HTTPPORT
140Authorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz
141Accept: */*
142
143GET /%TESTNUMBER0500 HTTP/1.1
144Host: %HOSTIP:%HTTPPORT
145Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=
146Accept: */*
147
148</protocol>
149</verify>
150</testcase>
151