Last updated February 3, 2013. Created by coltrane on April 1, 2011.
Log in to edit this page.
These steps should be compatible with 1.x and 2.x branches of the Bakery module for Drupal 6 and Drupal 7.
Bakery provides single sign-on (SSO) functionality for two or more sites. Deploy this module on the authoritative "master" Drupal server and the secondary "slave" or subsite server. The master and slave must be on the same domain*.
Enable Bakery on master site
Enable and configure Bakery on the master server first. It is recommended that you use the UID 1 Drupal account for this configuration.
1. Enable Bakery on the modules page
2. Visit the Bakery configuration page to setup Bakery
You must designate a site as the "Bakery account master".
3. Check the box for "Is this the master site?"
4. Enter the full URL of this site including ending forward slash
http://example.org/For SSO to work between sites, Bakery must know of the other sites, the "slave" or subsites.
5. Enter the full URLs of each slave site, separated by newlines, with ending slashes.
http://store.example.org/
http://groups.example.org/Two other required fields for Bakery to work are the private key and the cookie domain.
6. Enter a long and secure private key
7. Enter the domain to use for Bakery cookies. These cookies are shared so the domain should be the top level, with leading period. See the FAQ for more information about the leading period
.example.org8. Save configuration (we'll come back to the other fields)
Enable Bakery on a subsite
Now to enable and configure Bakery on the slave or subsite. It is recommended you use the UID 1 Drupal account for this configuration.
9. Enable Bakery on the modules page
10. Visit the Bakery configuration page to setup Bakery
This is a subsite of the master Bakery site.
11. Do not check the master site box
12. Enter the full URL of the master site set in step #4
13. The slave sites text-area can be left blank
14. Enter the exact same private key set in step #6
15. Enter the exact same domain set in step #7
16. Save configuration
Bakery should now be set to work for the master and this slave site. Open a different browser than the one you are currently using and visit the master site. Log in with a standard account. Once successful visit the slave site and confirm that you are also logged in.
See the FAQ if you are experiencing trouble. Use the Bakery issue queue for support questions.
* Master and slave must be on the same domain, but are not required to be at certain levels. For example, you can have the master be sub.example.com and a slave be example.com. The master and slave sites can be on different physical machines.
Comments
Cookie Domain directions conflict
The cookie domain instructions in settings.php do not suggest the leading period. In our Bakery Auth cookie, the leading period is needed. In the actual Bakery settings admin dialogue the suggestion does not include the leading period. I have configured sites using Bakery with and without the leading period. In fact, I even discovered one of my production setups with a slave with a period and a master without. The setup worked fine. Is there any reason we need to suggest the leading period here? It seems to me we should not for consistency. The auth cookie function can add it as necessary in the background.
Updated FAQ
I've updated the Bakery FAQ to answer this question, please see the last question before the troubleshooting tips section.
In short, they are different cookies and Bakery requires its cookie to have a leading period. Your mileage may vary, but the recommended practice is to have Bakerys with a leading period and settings.php cookie domain without.
Requires mcrypt
For Bakery to work php-mcrypt must be installed. To install this, use
yum install php-mcrypt.And Restart apache after installation, otherwise you get the error
Call to undefined function mcrypt_module_open()http://www.drupalfx.com
An unreasonable commitment to your success.