IdentityPython / SATOSA

Proxy translating between different authentication protocols (SAML2, OpenID Connect and OAuth2)
https://idpy.org
Apache License 2.0
197 stars 121 forks source link

backends/saml2: gracefully handle mismatching ACS #433

Closed bajnokk closed 1 year ago

bajnokk commented 1 year ago

This is a new attempt to solve #324 . The error message specifically targets the administrator / logs. Even though the exception message has an assumption (the original relay state might be missing for other, more unlikely reasons), but drawing the admin's attention to the mismatching request address and ACS address is a good idea in this case, IMHO.

Commit message follows:

When the IdP redirects to an ACS which has a different address than the one we used for initiating the request, we are unable to verify the RelayState, since the browser does not send the session cookie. In order to make configuration debugging easier, raise an explanatory SATOSAAuthenticationError instead of a KeyError.

While adding a unit test to check for the proper error reporting, some code duplication was refactored.

All Submissions:

c00kiemon5ter commented 1 year ago

closed by d9864643a5c606b2e2da14c0f5d6c5271178b5ac and 62f8775421734af08a337be18ff208d00a78bc71