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.


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.

  • 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."
    – apaderno
    May 17 '12 at 12:04

The modules for SSO I can find are the following:

  • The CAS module implements SSO using the phpCAS library. It can be used for sites that aren't on second-level domains.
  • The simpleSAMLphp Authentication module allows users to authenticate against a SAML Identity Provider, which could be a Drupal site running the drupalauth for simpleSAMLphp module.
  • The Account Sync module allows to synchronize accounts through different sites, and it has a simple support for single sign-on.
  • 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 the sub-domains share the database tables containing user information, 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.

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.

Between the modules I listed, only the CAS module has a release for Drupal 8.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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