I recently had a need to write a custom authentication module for Drupal 6. I struggled to find a good example from which to work. As anyone researching the topic knows, Drupal 6 dropped the couple of hooks that were in Drupal 5 that made custom authentication a brainless activity. It turns out, Drupal 6 isn't all that hard, once you know what to do. The below is my work, which I built after studying the user and the ldap authentication modules. Note that the below code will fail all logins. Why? To save you from yourself. Down towards the end there's a "if (1==1)". Yeap.