Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

prevent HTTP 413 #285

Closed
pschulten opened this issue Nov 15, 2017 · 9 comments
Closed

prevent HTTP 413 #285

pschulten opened this issue Nov 15, 2017 · 9 comments
Assignees

Comments

@pschulten
Copy link

@gambol99 Thanks for this project.
Is it possible to not send the Cookie Header to upstream?
In my current use-case I have no control on upstream and it has a very conservative header size policy :(
With encryption and refresh tokens the Cookie header is too large for upstream and it sends an 413

@jangaraj
Copy link
Contributor

How do your cookie sizes look like in the browser? There was my issue and my PR, which increase the effective size of data in the cookies - #278 - Do you use latest master branch version?

@pschulten
Copy link
Author

Thanks for this feature @jangaraj . I saw that and compiled from latest master branch but that didn't help in my case. The Cookie payload was around 3.8k. I guess my upstream has a hard header limit of 4k for all headers combined. I fixed it by stripping my JWT payload to the absolute minimum but It would be nice if the keycloak-proxy provides a switch to drop the openidc cookies on reverse proxying.

@jangaraj
Copy link
Contributor

I agree. I have had a similar issue, but I was able to increase header size limit in my infrastructure. My suggestion:

cookie-blacklist:
   - kc_access*
   - kc_state*

@gambol99
Copy link
Contributor

hi @pschulten ... i've started a PR to add the functionality #287 .. just need to fix up the unit test but i should have this available by the weekend

@gambol99 gambol99 self-assigned this Nov 18, 2017
@gambol99
Copy link
Contributor

fixed in #287

@gambol99 gambol99 reopened this Nov 23, 2017
@jangaraj
Copy link
Contributor

Note about potential cookie suffix: 81c7892

@gambol99
Copy link
Contributor

good spot @jangaraj !!!! ... i'll amend the check and update the unit test ... thank you kindly :-)

@pschulten
Copy link
Author

@gambol99 thank you very much. It works like a charm!
@jangaraj thanks for your support

@songokudbz
Copy link

Ty! Works. Nice solution.

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

No branches or pull requests

4 participants