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

Feature request: SAML2 Backend key/value store to store request IDs for running multiple instances #434

Open k4l397 opened 1 year ago

k4l397 commented 1 year ago

Code Version

8.2.0

Use case

If running multiple instances of the proxy it'd be useful to be able to connect an external store (e.g. redis) for request IDs. Currently request IDs are stored in memory (in a dictionary) which means if you're running 2 instances of the proxy, the same instance must receive the SAML response from the IDP.

Doing this should allow:

Possible Solution

c00kiemon5ter commented 1 year ago

Hello @k4l397

a possible easy workaround is to configure sticky sessions/cookies on your load balancer, so that requests end up on the same instance of the proxy. There are real deployments that work this way atm.

Having said that, we have been trying to avoid storing state on the server-side. This doesn't seem to be feasible anymore. I am looking towards introducing a storage backend to store session information and allowing plugins access to it; so, not just for request IDs. In particular Redis is a good choice because it allows us to set a TTL to records.

I will come back to this with more info, but this is timely as support for logout (#431 and #444) would also require to keep some state on the proxy side.