OLD | NEW |
---|---|
(Empty) | |
1 def main(request, response): | |
2 user = request.auth.username | |
3 password = request.auth.password | |
4 | |
5 if user == "user" and password == "password": | |
6 return "Authentication done" | |
7 | |
8 realm = "test" | |
9 if "realm" in request.GET: | |
10 realm = request.GET.first("realm") | |
11 | |
12 return ((401, "Unauthorized"), | |
13 [("WWW-Authenticate", 'Basic realm="' + realm + '"')], | |
14 "Please login with credentials 'user' and 'password'") | |
15 | |
OLD | NEW |