2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
10 \defgroup AuthAPIBasic Basic Authentication
14 Basic authentication provides a username and password. These
15 are written to the authentication module processes on a single
16 line, separated by a space:
22 The authentication module process reads username, password pairs
23 on stdin and returns either "OK" or "ERR" on stdout for
27 The following simple perl script demonstrates how the
28 authentication module works. This script allows any
29 user named "Dirk" (without checking the password)
30 and allows any user that uses the password "Sekrit":
34 $|=1; # no buffering, important!
38 $ans = &check($u,$p);
44 return 'ERR' unless (defined $p && defined $u);
45 return 'OK' if ('Dirk' eq $u);
46 return 'OK' if ('Sekrit' eq $p);