I am trying to find out whether it's possible to completely circumvent the users and authmap table to login to a drupal site using remote authentication. My drupal dev was working on this before she left me in the lurch!
The way she explained it was as follows -
"When a user logs into the site, Drupal will always check locally (i.e. in the users table) first for a username. If no matching name is found it will then look in the authmap table. If it finds no match it will create a new user.
For this reason, we have to create an entry in the authmap table for each of the existing external user ids so that when they log in with their extrenal username a new user is not created. Instead their external membership details will be mapped to their existing user account."
For this reason my client still has to import a CSV file of usernames each week to ensure the authmap table is up to date. They want to avoid having to do this as new users have to wait until their details are imported before they can login.
So my question is - is there a way of getting drupal to ignore the users and authmap table altogether and use remote authentication?
(isn't this what openid module does?)
(Would anyone potentially like to work on this issue?)
Any help much appreciated!
Alex
external auth in d6
You're on D6, right? You need to use hook_form_alter() to catch the submit operation of the login form. You can find more info here: http://drupal.org/node/263803
d5
Unfortunately it's D5.
hook_auth()
For D5 you need to implement hook_auth() where you do your external authentication, and then hook_user() to populate the user record in Drupal. I documented this some time ago here on my blog.