views:

62

answers:

4

We are currently transitioning our website to Drupal 6.x from a non Drupal source. One of the first issues we need to deal with is that of authentication. We have a central database where we keep member information. We will create a module to authenticate against this database however a question of whether or not to create users in the drupal is needed.

I'm worried that if we do not add user to the user tables and have our module keep sync that with the other database, then we will not be able to take advantage of other modules that may use the user module

My colleague on the other hand believes that this is not an issue we can add all necessary attributes to the global $user at authentication with our module.

Is there a standard way of dealing with this problem?

Thanks!

David

A: 

Do you need to have both sites running in parallel? If not, then you don't need to sync the user tables. A conversion will be enough then.

Niels Bom
+2  A: 

Look at the LDAP_integration module, they do something similar. When logging in and a local user cannot be loaded, a user is searched for in another application and when user&pass are equal, the user is copied in the Drupal usertable.

Niels
+1  A: 

If you want any Drupal functionality (read: core and modules) to be associated with that user account, then you will need to use that user table.

This is especially true for anything node-related, so if you want people to be able to create nodes with referenced data you will need it. uids are stored in the nodes table in order to show who authored the node. Storing a uid in the nodes table with a something that doesn't exist as a relational key to somewhere else will only return an empty object. For instance, if a person wants to see the author of X node they will get an empty user object. Keep it. There's no sense in working harder just to remove it. Besides, you can store as little or as much as you want in the user object for each account.

Andrew Sledge
Thanks, it turns out that Drupal, automatically creates a user on the user table so that wasn't an issue.
DKinzer
+1  A: 

I'd also suggest looking at the LDAP module. I was able to use it as a jumping in point to interface with a custom WSAPI authentication method for an external database that we have at my company.

Tim S

related questions