Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem
Bakery is hard to customize for specific use cases:
- 7.x-2.x does not do user field sharing (see #1107692: Port bakery 6.x-2.x to 7.x-2.x for details)
- Registration and login redirect can break too easily
- Bakery's methods for uniquely identifying user across sites is out-dated and should now use UUIDs
- Bakery development is difficult because of cookie metaphors and use
- Hard to test
Proposed solution
Simplify Bakery down to what it does best: creating and validating a cookie and authentication
Employ a hook system to allow site-specific customization of user-related process flows and data management (related #556666: Sync hooks: Enable sharing of arbitrary data)
Comment | File | Size | Author |
---|---|---|---|
#15 | interdiff.txt | 35.89 KB | m1r1k |
#15 | bakery-3.x-branch-1232914-16.patch | 72.04 KB | m1r1k |
#14 | bakery-3.x-branch-1232914-15.patch | 47.82 KB | m1r1k |
#3 | Bakery-remove-profile-support-1232914.patch | 2.6 KB | coltrane |
Comments
Comment #1
coltraneWe could use a map format, textarea for defining machine names, master to remote. 7.x-2.x would have a field depending on if it's master (fields to profiles) or slave (profiles to fields) though the textarea needs to also allow both 7.x master and slave.
Comment #2
gregglesTimezones are also not shared.
Comment #3
coltraneThis patch readies Bakery 6.x-2.x for no longer explicitly handling Profile fields. Subsequent patches will build off this.
Comment #4
fuzzy76 CreditAttribution: fuzzy76 commentedSubscribing. Even just a backend engine with some hooks would've been useful here.
Comment #5
sumitk CreditAttribution: sumitk commentedWe need this for DrupalCon website and mobile apps .... any updates here?
Comment #6
gregglesNo, and I think it's very unlikely any will appear organically unless Ben has more time/energy for this than I imagine.
Comment #7
sumitk CreditAttribution: sumitk commentedOkay I solved this by fetching speaker bio fields form d.o ... so not a blocker for me now.
Comment #8
kaizerking CreditAttribution: kaizerking commentedhave any one thought about this data sharing,
I have D7 and D6 as sub domain using bakery SSO it is working fine, I also want toshare some data from D7 to D6 and soem data from D6 to D7, is there any way out
or else can we share the screens of each other
if i use bartik theme and 1 column will display data from D6 and if i am in D6 1 column from D7 or some sort of solution?
Comment #9
coltraneRefocusing this issue to be about Bakery 3.x - will update the issue summary
Comment #10
tunicTalking about Bakery Nougat functionality I think that Bakery has to use more Drupal-generic mechanismo to implement its functionality. For example, Bakery hooks to login/register form, so any other operations with user that do not use those forms are completely ignored by Bakery.
Comment #11
coltranetunic, can you elaborate on the problem you allude to in #10? What other operations would you want Bakery to interact with?
Any suggestions or ideas around a solution?
Comment #12
tunicBakery hooks on form_alter to set its own submit handler for user register form. That's ok for the use case where a user registers himself, but it fails if a user is created programatically, because no user form submit handler is fired. Also, because Bakery redirects user client to master to get the Chocolate Chip cookie. This prevents to use Bakery mechanism to create users because it may be no browser to redirect to master. That's why Bakery Nougat was needed.
Comment #13
coltraneI've pushed a 3.x branch to git and created a dev release. Branch contains a Bakery class for containing Bakery's core functionality of creating and validating an SSO cookie.
I've stripped the .module of its other functionality for now. Will need to figure out what is part of core Bakery and what's appropriate for sub-modules.
Comment #13.0
coltraneUpdated issue summary.
Comment #14
m1r1k CreditAttribution: m1r1k commentedLets introduce some hooks and try to split bakery module into at least two parts: main one that contains only SSO related logic and move all synchronization and drupal messages to separate on 'bakery_own_sync' to avoid massive overrides if we have separate sync engine like services.
Here is a first version of patch
Comment #15
m1r1k CreditAttribution: m1r1k commentedHere is another update
Comment #16
ar-jan CreditAttribution: ar-jan commentedHere's an example that I suppose could (or should) be made possible by this issue: an option to allow only users with a particular user role on the master site to login to a slave site.
Would that be possible?
Comment #17
fuzzy76 CreditAttribution: fuzzy76 commentedWhat happened to 3.x? Are there still plans to finish the rewrite?