Mod_auth_webform is a project mainly written in C and PHP, it's free.
Apache authorization module using a web form