For a long time, I had no clue what PAM was or how "pluggable" it was. After stumbling upon a couple of google hits, I decided to give it a go with Squid web proxy cache.
It's really a piece of cake.
Rather than modifying pam_auth.c in the Squid source files, just make a symbolic link within OS X:
sudo ln -s /usr/include/pam /usr/include/security
Create /etc/pam.d/squid with the following contents:
auth required /usr/lib/pam/pam_securityserver.so
auth required /usr/lib/pam/pam_permit.so
Before compiling squid, remember to enable PAM:
./configure --enable-auth=basic --enable-basic-auth-helpers=PAM,NCSA,LDAP
After "making" squid, update squid.conf to use PAM for basic auth:
auth_param basic program /usr/local/squid/libexec/pam_auth
auth_param basic children 5
auth_param basic realm SQUID
auth_param basic credentialsttl 2 hours
Now, one can authenticate with the Squid proxy using Mac OS X user credentials.