Drupal Single Sign-on with Multiple Databases

This is a highly experimental project, I've had some funky experiences using it myself, so consider yourself warned.

There are a few single sign on modules for Drupal, you can read about some of them here.

None of them worked for me because:

  • I don't really like solutions that work outside of the Drupal system.
  • I don't like to use database prefixing, so sharing tables is not ideal.
  • I do like to use Drupal's ability to work with multiple databases.

Some of the realities of building a single sign-on module are:

  • The user has to have a session on that sub-site to get logged in. Which means they have to visit the sub-site with their browser to set a cookie and get an entry in the session table. You can't do that from the main-site. Because:
    • The main-site isn't allowed to write a cookie for the sub-site.
    • The main-site isn't allowed to read from the sub-site cookie.
Far from being anything you'd want to put on a production site, maybe use this it as a case study for your own work...
AttachmentSize
sso_multidb.zip4.05 KB