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

SSO does not work for users with a lot of groups due to exceeding max browser cookie size limit #10153

Closed
3 tasks done
kolorful opened this issue Dec 1, 2022 · 11 comments · Fixed by #11774
Closed
3 tasks done
Labels
area/sso-rbac P2 Important. All bugs with >=3 thumbs up that aren’t P0 or P1, plus: Any other bugs deemed important type/bug

Comments

@kolorful
Copy link
Contributor

kolorful commented Dec 1, 2022

Pre-requisites

  • I have double-checked my configuration
  • I can confirm the issues exists when I tested with :latest
  • I'd like to contribute the fix myself (see contributing guide)

What happened/what you expected to happen?

After setting up Argo Workflow with an external SSO we noticed certain users can login with correct groups showing up while others cannot. Argo server logs show "token not valid for running mode".

To debug, we compiled Argo Workflow ourselves and added tons of debug logs.

Eventually we were able to pinpoint everything is normal until the part that sets authorization Cookie in HandleCallback. In non-working case the final Cookie size is 5000+ bytes, which exceeds the 4096 bytes limit. This causes the authorization Cookie not to be written at all, which makes subsequent requests do not contain the "authorization" header and leads to "token not valid for running mode" since it's empty.

I think we probably need to consider reducing the size of this Cookie or use a different approach?

Thanks.

Version

V3.4.3

Paste a small workflow that reproduces the issue. We must be able to run the workflow; don't enter a workflows that uses private images.

N/A, just set up an fresh Argo Workflow with SSO then login with a user that has a ton of groups so cookie will exceed 4096 bytes

Logs from the workflow controller

N/A

Logs from in your workflow's wait container

N/A
@kolorful kolorful changed the title SSO does not work for users with a lot of groups due to max browser cookie size SSO does not work for users with a lot of groups due to exceeding max browser cookie size limit Dec 1, 2022
@tooptoop4
Copy link
Contributor

maybe similar to #9530

@sarabala1979 sarabala1979 added P3 Low priority P2 Important. All bugs with >=3 thumbs up that aren’t P0 or P1, plus: Any other bugs deemed important and removed P3 Low priority labels Dec 8, 2022
@stale

This comment was marked as resolved.

@stale stale bot added the problem/stale This has not had a response in some time label Dec 31, 2022
@tooptoop4

This comment was marked as resolved.

@stale stale bot removed the problem/stale This has not had a response in some time label Jan 1, 2023
@stale

This comment was marked as resolved.

@stale stale bot added the problem/stale This has not had a response in some time label Jan 21, 2023
alexec added a commit that referenced this issue Feb 13, 2023
… size. Fixes #9530, #10153 (#10170)

Signed-off-by: Kewei Ma <kewei@indeed.com>
Signed-off-by: Alex Collins <alex_collins@intuit.com>
Co-authored-by: Alex Collins <alexec@users.noreply.github.com>
Co-authored-by: Alex Collins <alex_collins@intuit.com>
@kolorful
Copy link
Contributor Author

Note: #10170 did not fully fix the issue.

@stale stale bot removed the problem/stale This has not had a response in some time label Feb 13, 2023
@stale

This comment was marked as resolved.

@stale stale bot added the problem/stale This has not had a response in some time label Mar 25, 2023
terrytangyuan pushed a commit that referenced this issue Mar 29, 2023
… size. Fixes #9530, #10153 (#10170)

Signed-off-by: Kewei Ma <kewei@indeed.com>
Signed-off-by: Alex Collins <alex_collins@intuit.com>
Co-authored-by: Alex Collins <alexec@users.noreply.github.com>
Co-authored-by: Alex Collins <alex_collins@intuit.com>
@kolorful

This comment was marked as resolved.

@stale stale bot removed the problem/stale This has not had a response in some time label Jun 7, 2023
@basanthjenuhb
Copy link
Contributor

basanthjenuhb commented Sep 8, 2023

I tried splitting the large cookie, but seems very complex
One simple solution can be, filter groups received after Oauth

sso:
  scopes:
   - groups
   - email
filterSSOGroupsRegex: "argo-wf"
rbac:
  enabled: true

this way, backend would filter out groups received, and keep the only groups that contain "argo-wf".
Since the number of groups that remain would be very small, users can use this to limit the number of groups

@sarabala1979 @juliev0 @alexec wdyt ?

@agilgur5
Copy link
Member

agilgur5 commented Sep 9, 2023

I tried splitting the large cookie, but seems very complex

Argo CD seems to have implemented cookie splitting in argoproj/argo-cd#5497

@basanthjenuhb
Copy link
Contributor

basanthjenuhb commented Sep 10, 2023

I tried splitting the large cookie, but seems very complex

Argo CD seems to have implemented cookie splitting in argoproj/argo-cd#5497

I guess we could also implement cookie splitting on top of filtering.

@agilgur5
Copy link
Member

I guess we could also implement cookie splitting on top of filtering.

Yea for any users finding themselves here, if groups filtering does not suffice for your needs, please open a new enhancement request for cookie splitting.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/sso-rbac P2 Important. All bugs with >=3 thumbs up that aren’t P0 or P1, plus: Any other bugs deemed important type/bug
Projects
None yet
5 participants