Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path property in CookieSessioProvider struct is missing #533

Open
John-Chr opened this issue Sep 8, 2023 · 0 comments
Open

Path property in CookieSessioProvider struct is missing #533

John-Chr opened this issue Sep 8, 2023 · 0 comments

Comments

@John-Chr
Copy link

John-Chr commented Sep 8, 2023

It is currently not possible to set the SessionCookie to a specific path.

While trying to implement the Multi Tenancy functionality for a cloud based system I encountered the following problem.

Let's assume the application is to manage multiple tenants through one or more IDPs. In the service the individual tenants/customers are configured, for each tenant an own SAML middleware is created, which contains information regarding cookie, singnrequest, IDMetadata, certificate URL and others.

After a successful login, the cookie containing information about the SAML session should not be managed on domain level, but on path level.

Problem explained by URLs:

  1. Start url of tenant 1: https://test-cloud.com:9090/tenant-1
  2. Start url of tenant 2: https://test-cloud.com:9090/tenant-2

The cookie is created at "https://test-cloud.com:9090". Means the property path of the HttpCookie has the value "/".

A possible solution

  1. Start url of tenant 1: https://test-cloud.com:9090/tenant-1
  2. Start url of tenant 2: https://test-cloud.com:9090/tenant-2

The cookie is created under "https://test-cloud.com:9090/tenant-1" or "https://test-cloud.com:9090/tenant-2". That means the property path of the HttpCookie has the value "/tenant-1" or "/tenant-2".

Is there a possibility to define the path of the cookie dynamically, similar as it is possible with cookie name?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant