Skip to content

Options to not send oauth2-proxy specific cookies to upstreams #1993

@segaura

Description

@segaura

Oauth2-proxy cookies, especially in cookie storage mode, can be big in size, think of a access, refresh and id token combination stored inside cookies, for instance.

Expected Behavior

Oauth2-proxy could accept a new configuration parameter which allows to remove its own cookies from requests to be sent to upstreams.

Current Behavior

Currently there are solutions in place to stip entire headers, but the Cookie header mixes oauth2-proxy own cookies with ones for other destinations.
So while my spring-boot upstream needs only its "JSESSIONID" cookie, it now receives also _oauth2_proxy_0 and _oauth2_proxy_1 which are more than 6KB together.

Possible Solution

In headers.go, along with others header treatment, which already take care of stripping some of them and removing configured informations, it should be possible to split the Cookie content and remove oauth2-proxy specific cookies from it.

Context

My main concern regards performance, because in cookie storage mode, cookie size is typically 6KB in my context.
We find some of our Tomcat-based upstreams rejecting requests because they exceeded the 8KB default limit for headers size.

Your Environment

  • Version used:

7.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions