@@ -47,6 +47,10 @@ func (as *AmaltheaSession) auth() (manifests, error) {
4747 Port : intstr .FromInt32 (authenticatedPort ),
4848 },
4949 }
50+ sameSiteCookieFlag := "strict"
51+ if useNoneSameSiteSessionCookie {
52+ sameSiteCookieFlag = "none"
53+ }
5054 oauth2ProxyContainer := v1.Container {
5155 Image : authproxyImage ,
5256 Name : "oauth2-proxy" ,
@@ -59,6 +63,7 @@ func (as *AmaltheaSession) auth() (manifests, error) {
5963 fmt .Sprintf ("--http-address=:%d" , authenticatedPort ),
6064 "--silence-ping-logging" ,
6165 "--config=/etc/oauth2-proxy/" + auth .SecretRef .Key ,
66+ fmt .Sprintf ("--cookie-samesite=%s" , sameSiteCookieFlag ),
6267 },
6368 VolumeMounts : append (
6469 []v1.VolumeMount {
@@ -89,6 +94,9 @@ func (as *AmaltheaSession) auth() (manifests, error) {
8994
9095 output .Containers = append (output .Containers , oauth2ProxyContainer )
9196 case Token :
97+ if useNoneSameSiteSessionCookie {
98+ return output , fmt .Errorf ("cannot set the same site cookie parameter for anonymous sessions" )
99+ }
92100 volName := fmt .Sprintf ("%sproxy-configuration-secret" , prefix )
93101 output .Volumes = append (output .Volumes , v1.Volume {
94102 Name : volName ,
@@ -143,6 +151,10 @@ func (as *AmaltheaSession) auth() (manifests, error) {
143151 Port : intstr .FromInt32 (authenticatedPort ),
144152 },
145153 }
154+ sameSiteCookieFlag := "strict"
155+ if useNoneSameSiteSessionCookie {
156+ sameSiteCookieFlag = "none"
157+ }
146158 oauth2ProxyContainer := v1.Container {
147159 Image : authproxyImage ,
148160 Name : "oauth2-proxy" ,
@@ -154,6 +166,7 @@ func (as *AmaltheaSession) auth() (manifests, error) {
154166 "--silence-ping-logging" ,
155167 "--alpha-config=/etc/oauth2-proxy/oauth2-proxy-alpha-config.yaml" ,
156168 "--config=/etc/oauth2-proxy/oauth2-proxy-config.yaml" ,
169+ fmt .Sprintf ("--cookie-samesite=%s" , sameSiteCookieFlag ),
157170 },
158171 EnvFrom : []v1.EnvFromSource {
159172 {
0 commit comments