Closed (fixed)
Project:
Bakery Single Sign-On System
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Jun 2010 at 02:18 UTC
Updated:
14 Apr 2011 at 09:21 UTC
Jump to comment: Most recent file
Comments
Comment #1
juliangb commentedDoes this happen every time for you? If so, make sure the list of slaves in the master settings form is complete.
I find this happens to me intermittently, but I can't seem to find a pattern yet.
Comment #2
gábor hojtsyJust marked #839342: Bakery does not redirect you back to subsite when logged in as duplicate of this, and this happens reliably on drupal.org. Quoting what I said there.
Comment #3
juliangb commentedI've just tested this with drupal.org as follows:
- I logged out of drupal.org, went to groups.drupal.org and onto a group homepage.
- Clicked login from g.d.o.
- Was redirected to d.o. and logged in.
- Was redirected back to exact page I was on before on g.d.o. (from destination
So seems to be working for me...
Is this the method that you're talking about too?
The times I have seen this issue are on my own installations, but as I said before, it is intermittent and I haven't seen a pattern yet.
Comment #4
avpadernoThe redirection to the slave site doesn't happen in api.drupal.org, in example. If, for any reasons, you are not logged in on api.d.o, when you click on the link you are redirected to d.o, but after logging in you are not redirected to api.d.o.
This could depend from the version of Bakery used on api.d.o; it could be the problem has been fixed on Bakery, but api.d.o is not using an updated version of Bakery. Another explanation is that g.d.o is using custom code to redirect the user back to its pages.
Comment #5
dominict commentedAny updates on this? I am evaluating Bakery to implement into a site network for a client preferring its profile passthrough to Shibboleth's but need to know this is working.
Comment #6
avpadernoComment #7
juliangb commentedHere is a patch for review.
EDIT: It needs applying to the MASTER site. It does not matter whether the slave site is patched or not.
Comment #8
gregglesI don't think that works well for us. We added the feature to make sure that it didn't redirect to external sites as a security measure, so circumventing it is a bad idea.
We could perhaps confirm the destination against the list of slave servers before redirecting as a way to maintain good UX and moderate security.
Comment #9
juliangb commentedI suppose there would be no harm in checking against the list of slave sites, although considering that the destination is taken from the (encrypted) cookie, it is perhaps a little unnecessary? i.e. - the requester has to know the bakery_key .
Comment #10
juliangb commentedSo that we can get a fix for this bug out, here is a patch that checks for whether the url in the cookie destination is saved as a bakery slave. I think it is a mainly cosmetic security enhancement considering the bakery_key is needed for the cookie to be valid anyway.
If the destination is not a bakery slave, this is logged in the watchdog.
Comment #11
avpadernoIt seems good to me.
I think it's better to check once more than to be sorry then; once the the destination URL is checked against the list of slave domains, we are 100% sure nobody can play tricks with bakery cookies.
Comment #12
juliangb commentedIt occurs to me that during the D7 port, the drupal_goto had the external attribute added which is why this bug is only applicable to D6.
Hopefully it doesn't have to slow the D6 fix up, but if #10 is OK, we'd probably want to add the slave check into D7 also.
Comment #13
juliangb commented@kiamlaluno,
Can you RTBC based on the patch in #10?
Comment #14
coltraneSince this is manually redirecting, I think we should duplicate some of the shutdown code from http://api.drupal.org/api/function/drupal_goto/6
Powered by Dreditor.
Comment #15
avpaderno@coltrane: Do you mean something like this?
Comment #16
avpadernoI re-rolled the patch for the latest development of Bakery.
Comment #17
avpadernoNew version with more comments.
Comment #18
juliangb commentedAll seems good to me. Seems like a good improvement and really well commented.
Comment #19
coltraneNow that you can register and log in from the slave site, is this issue needed anymore?
I'd only say so if we planned to turn the slave register and login into optional functionality.
Comment #20
avpadernoI apologize if I am reporting it in the wrong place, but I tried to log out from l.d.o and to log in; when I click on Login / Register, from l.d.o I am redirected to http://drupal.org/translate/downloads?destination=translate%2Fdownloads&no_cache=1287581302, which is a not existing page, nor is the login page.
Comment #21
mfer commentedsubscribe
Comment #22
Crell commentedThis is a critical bug for chicago2011. (Subscribe)
Comment #23
coltraneUnless we make slave login optional let's alter the discussion here to be about the problem of carrying the destination parameter through the login process. I think that's the only missing functionality now.
Holding onto the destination in the cookie is probably good, but the master will still have to return the user to the Bakery specific slave callback, then the destination can be pulled for the correct redirect.
Comment #24
coltraneHere's an operational patch, but CNW. It should verify the destination is on the slave and also work for the registration form.
Comment #25
coltraneActually, using the second argument to parse_url() means an absolute URL won't be parsed, so I don't believe any further protection is needed.
Also, rewriting URLs would be required to carry the destination param to user/register, something Bakery shouldn't do I think.
This patch makes the first comment, and is CNR.
Comment #26
gregglesLooks great to me. http://drupal.org/cvs?commit=504588
Comment #27
gregglesIt seems this needs some more urlencoding/decoding to work properly.
From a "login to post comments" link I ended up on node/389%2523comment-form instead of node/389#comment-form
Comment #28
coltraneHow's this?
Comment #29
leisareichelt commentedannoyingly subscribing because I think this is a v important UX issue that drive me utterly nuts and I want to poke it if it gets waylaid ;)
Comment #30
gregglesNow committed - http://drupalcode.org/project/bakery.git/commit/6c10b45
Comment #31
gregglesI should say: I tested/reviewed this and it seems like the ideal way to handle this.
Comment #32
gregglesDeployed on drupal.org so this should work with any subsite that has a moderately recent version of Bakery.
Comment #33
leisareichelt commentedI logged in this morning from my iPhone - clicked on a 'reply to this' link in an email generated by Groups, had to log in and was taken to my profile page.
What's next? See if Groups need to update Bakery?
Comment #34
gregglesIndeed it was necessary to update bakery on groups.drupal.org. I've just done that and it seems to work.
Also, marking this fixed since we are not going to port these individually. See #1107692: Port bakery 6.x-2.x to 7.x-2.x for more details if interested.
Comment #35
leisareichelt commentedyep, had the same situation last night (as per #33) and it worked perfectly. thanks!