Repeatable: Always
Steps to repeat:
1. run drush cr on server
2. Try to log in with /saml/login
Expected Results:
User is logged in configured saml service, returned to drupal and given a valid drupal session
Actual Results:
User is logged in to configured saml service and returned to drupal, but receives the error message below at /saml/acs:
The controller result claims to be providing relevant cache metadata, but leaked metadata was detected. Please ensure you are not rendering content too early.
Refreshing the page will show drupal with the correct session, but the error is displayed for some reason.
Comments
Comment #2
roderik@$^@%#%$$%@$%#$%#$ cacheability metadata and URLs...
(At least digesting all the discussion around it in the past month, got me to a point where I'm not despairing after your bug report.)
So... I can't reproduce this.
1)
First things first: I discovered an error in the code while typing up this answer. Does making the following (temporary) change help?
2) If that's not it:
From all I know right now, this is not directly an issue with the code in the samlauth module (although it is possible for the samlauth module to take measures to prevent it). I instead suspect code that is executed on an event or a hook that is called by /saml/acs.
So:
If a cause can be pinpointed, I'd love to know, because I want to dive into this URL/Leaked Metadata mess.
3)
Regardless, I'll have a patch soonish. First attempt failed, so I'll need to do a little more work (hopefully) tomorrow.
Comment #3
nicolas-mosch commentedHello Roderik,
thank you very much for your quick reply. Indeed you are correct; I tried uninstalling some modules and reproducing the issue and it appears that after uninstalling the LDAP module (the 'User' module from LDAP in particular) I could no longer reproduce it.
I will try to find the source of the problem in their code, although any help would be greatly appreciated if possible as I am not exactly sure what I am looking for.
Comment #4
roderikThank you nicolas-mosch.
Looking at the bug in the LDAP/user module code yourself is optional, because samlauth likely can and should prevent the LDAP/user module from having this effect.
I personally still want to check out their code and see if a bug report should be filed, because I spent some time trying to work out the depth of the problem surrounding this "Leaked metadata" exception in detail, and this is a practical example where I can verify practical obstacles.
But if you really want to know:
Fixing the samlauth module to work around the dangers, will be easier than reading all this. I just need time to sit down and continue, one of these evenings.
Comment #6
roderikWell, that took longer than I hoped... Had another half year break on working on this module.
I've now decided which way I want to solve this, and pushed a fix to the 3.x-dev branch.
What you can also do, instead of using this -dev branch, is try to apply #3092008: Possible fix to "leaked metadata" exception to the ldap_user module, and see if the issue goes away. Because I've uploaded a patch for what I think is the code causing the exception, but haven't tested it. So I don't know if it's complete.
Comment #7
roderikComment #8
roderikSince there have been no further reports about leaked metadata, I'll assume (admittedly for the third time) that the code is now handling all possible situations correctly.