indigo-iam / iam

INDIGO Identity and Access Management Service
https://indigo-iam.github.io/
Other
99 stars 43 forks source link

Incorrect fail match for `InResponseto` SAML field with redis HTTP session store #710

Closed DonaldChung-HK closed 2 weeks ago

DonaldChung-HK commented 4 months ago

Description

When using redis as storage HttpSession

  1. The indigoiam container POST a SAML request to SAML Idp
  2. It stores the ID to a HttpSession
    01:48:46.551 DEBUG 6 --- o.s.s.saml.storage.HttpSessionStorage    : Storing message {ID} to session c5336582-6039-49a9-b052-5b9b45079651
  3. The container receives SAML response from Idp
  4. The container tries to retrieve the ID from the wrong session causing it to fail the InResponseto check
    01:48:50.849 DEBUG 6 --- [nio-8080-exec-9] o.s.s.saml.storage.HttpSessionStorage    : Message {ID} not found in session 20b60cf8-1c32-4084-b060-a0205dea2949
    org.opensaml.common.SAMLException: InResponseToField of the Response doesn't correspond to sent message {ID}

    To Reproduce

    This doesn't happen when using internal session storage. Set up IAM SAML with Redis as HttpSession Store and nginx reverse proxy using native forward header strategy and running on host network mode. Try to use SAML login. See the above description.

Possible reason for the issue

Task or fixes

federicaagostini commented 4 months ago

Thank you very much for the detailed issue! We will look soon into this.

DonaldChung-HK commented 2 weeks ago

Hi INDIGO IAM team,

I am closing this issue. I discovered that this is caused by my organisation's test SAML IDP enforcing SameSite=Strict cookie which caused it to go wrong.

Thanks.