Compatibility with samlauth >= 8.3

Created on 15 June 2021, over 3 years ago
Updated 3 January 2024, 12 months ago

Problem/Motivation

samlauth >= 8.x-3.3 changed its configuration structure. I forgot to check how that would influence ACSF. Sorry about that.

samlauth still reads configuration values from the old locations for now, but

  • only if the new locations are not populated. (So below effect 1 likely only manifests after running update.php on a newer samlauth module.)
  • this 'backward compatibility' behavior is not going to be around in the samlauth module forever.

This has two separate kinds of effects after samlauth >= 8.x-3.3 is installed:

1)
What happens: On non-live environments, on every request, acsf's SamlauthRequestSubscriber overrides (in-memory) configuration values at an 'old' location/key.

Effect: people get errors on login*: "Signature validation failed. SAML Response rejected". Reason: the live IDP certificate value is seen (because it is read from the new config location / isn't overwritten with the non-live certificate). Reported in πŸ› v3.3 change in configuration values breaks ACSF Active

Fix: apply included patch / update to fixed acsf module; errors will go away.

2)
What happens: On all environments, acsf.install saves the IDP certificate configuration value for newly provisioned sites into the 'old' location.

(Note the non-zero possibility that some people do a test upgrade to the new ACSF module, forget to check if login works on test, do not see the failure from effect 1, and then upgrade their live env.)

Immediate effect: nothing for now, on the live environment.

Longer term effect: you now have sites with the IDP certificate written into two locations:

  • older sites that were provisioned before 8.x-3.3 was installed, will have IdP cert config moved to the new location by samlauth_update_8305()
  • newer sites that were provisioned after 8.x-3.3 was installed / without the included patch, will still write IdP cert config to the old location.

This can cause breakage for login to those newer sites, when the 'compatibility layer' in 8.x-3.x, which reads values from the old location, is removed. I plan to do this in samlauth 4.0.0 (and will likely release alpha versions that still have it). At the same time, I'll include an update hook that re-checks/re-moves the IdP cert value again.

This means that if any sites upgrade to samlauth v4.0.0+ without having the included acsf patch applied, then 1) the sites provisioned after previously upgrading to samlauth 8.x-3.3+ will break login on the live environment; 2) you are on your own in making an upgrade script that fixes the configuration.

So I urge you to apply this patch in a new release that drops compatibility with samlauth <8.x-3.3, before samlauth 4.0.0 is released - for your own sake.

Steps to reproduce point 1

  • install samlauth >= 8.x-3.3 on test
  • run code update (I think it doesn't happen if the code is replaced without running update hooks)
  • see login failures.

Remaining tasks

  • Apply patch. Test it; I didn't.
  • Recommended: figure out your composer dependencies for acsf_sso. (The patch only has the updated dependency in the info.yml so far.)
    If you don't add the composer dependency, there's a chance the customer will not update to samlauth >= 8.x-3.3 while installing the new acsf_sso.
    • I think this won't have any immediate effect and the config will likely be rectified on a samlauth 4.0.0 upgrade (see point 2 above)... but still, IMHO this is a good time to figure things out.
    • ...but that any new sites created with the updated acsf module that do not upgrade to samlauth >= 8.x-3.3 at the same time (which is the inverse of above bolded statement), will have immediately-breaking login on all environments
    • Note I still haven't figured out what is the recommended drupal policy: all dependencies in root composer.json or a separate acsf_sso/composer.json (does a standard Drupal composer install pick these up)?)
  • Then release this fix in an acsf version where acsf_sso has a dependency on samlauth >= 8.x-3.3, in both the composer.json and the info.yml file.

If you see any holes in this reasoning / where your customer sites can still end up with wrong config and samlauth should assist with that... let me know.

πŸ› Bug report
Status

Fixed

Version

2.73

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands roderik Amsterdam,NL / Budapest,HU

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States minkahb

    Hi,

    I'm using samlauth version samlauth 8.x-3.8, and I'm getting the message "Signature validation failed. SAML Response rejected."

    I tried various reverse_proxy settings in settings.php in order to get the module to use https for the acs URL.

    No matter what I set for these values, I get the error:

    $settings['reverse_proxy_addresses']

    $settings['reverse_proxy_header']

    $settings['reverse_proxy_proto_header']

    $settings['reverse_proxy_host_header']

    I also have these settings enabled:

    $settings['reverse_proxy'] = TRUE;

    $settings['reverse_proxy_trusted_headers'] = \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_ALL | \Symfony\Component\HttpFoundation\Request::HEADER_FORWARDED;

  • πŸ‡ΊπŸ‡ΈUnited States minkahb

    Sorry, I re-read the thread and it seems the solution is to use 3.2 for now?

  • πŸ‡ΊπŸ‡ΈUnited States minkahb

    Hi,

    I have a site on Drupal 9.5.3, with php 8.3.2. I installed samlauth 8.x-3.8 via composer. I wanted the ACS url to return as https instead of http.

    I enabled various reverse_proxy values in settings.php and now I see the ACS url with https, but I get the error "invalid_response; reason given for last error: Signature validation failed. SAML Response rejected" .

    I went back to samlauth 8.x-3.2, and I am still getting the error "invalid_response; reason given for last error: Signature validation failed. SAML Response rejected".

  • πŸ‡ΊπŸ‡ΈUnited States minkahb

    Just to wrap this up, the issue was because I was using the wrong certificate.

  • πŸ‡³πŸ‡±Netherlands roderik Amsterdam,NL / Budapest,HU

    minkahb's comments are unrelated to this issue.

    (I reworded some things for hopefully improved clarity, and removed a remark about D10 compatibility - because samlauth 8.x-3.x is still compatible with D10.)

  • Status changed to Fixed 12 months ago
  • πŸ‡ΊπŸ‡ΈUnited States erin.rasmussen

    Fixed in versio 2.72 - 2.73 or later (ACSF version).

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024