Tell me more ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I have two instances of Drupal on same server instance 1 and instance 2 with different databases. I want the following feature: unique login for both instances.

When I login to instance 1 and if I open the URL of instance 2 on same browser then it should not ask me to log in again. While any add/update operation is performed on instance 1 or instance 2, the user table should be updated in both databases.

share|improve this question

2 Answers

This is not something that it easy to accomplish, your main problem will be to keep track on the users on the two instances, since users doesn't have a Global Unique ID (GUID) but instead uses the user id or uid which is a simple serial id.

You also have to figure out how to handle people editing the same profile at the same time on the two different sites, which easily can lead to some major headaches when site 1 wants to update site 2 and vice versa.

You can take a look at the bakery module which can be used for a single signup system. I'm not sure this will be useful out of the box for you, but you probably could find some inspiration to how you can handle signing in users on multiple sites.

In any regard - you will probably need some custom coding or a clever module I haven't heard off yet.

share|improve this answer
I think the user is speaking of SSO. The operations he is referring are operations on the user profile, as he says, "the user table should be updated in both databases." – kiamlaluno May 17 '12 at 12:04

The modules for SSO I can find are the following:

  • The Bakery Single Sign-On System allows users to be logged in on different sub-domains, such as drupal.org, api.drupal.org, and groups.drupal.org. It doesn't require using a single database table for the users in the sub-domains, but it works only on sub-domains, as it uses some cookies. It updates some fields used in the user profile, and a user that is blocked in the master site is also blocked in the client sites. Updating user fields is a feature that is going to be removed from future versions of the module, as the module is going to be a pure SSO module.
  • The Single Sign-On module can be used for multiple web sites, but they all need to use the same table for the user's data. Also in this case, users that are logged onto the master site will automatically be logged into any slave site.
  • The Ubilogin module allows you to use SSO using the Ubilogin services. This module doesn't have any published releases, and it doesn't seem to update user's data.

If the instances you are referring are sub-domains, then Bakery is a start, even though you would need to write custom code to update the fields you need to keep update between the different sub-domains. The task would be simplified from the cookies the module uses, and from the fact that the init field present in the "users" table is set, in the slave sites, to the profile link in the master site.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.