@@ -63,6 +63,7 @@ type Config struct {
6363 OidcValidatorIdpIssuerURL string `koanf:"oidc-validator-idp-issuer-url"`
6464 OidcScopes string `koanf:"oidc-scopes"`
6565 OidcUseAccessToken bool `koanf:"oidc-use-access-token"`
66+ OidcUseCookie bool `koanf:"oidc-use-cookie"`
6667 OidcSkipTLSVerify bool `koanf:"oidc-skip-tls-verify"`
6768 OidcCAFile string `koanf:"oidc-ca-file"`
6869 MeUsernamePath string `koanf:"me-username-path"`
@@ -86,10 +87,10 @@ type Config struct {
8687}
8788
8889func (c * Config ) Validate () error {
89- if ! c .InCluster && (c .OidcClientID != "" || c .OidcClientSecret != "" || c .OidcIdpIssuerURL != "" ||
90+ if ! c .InCluster && ! c . OidcUseCookie && (c .OidcClientID != "" || c .OidcClientSecret != "" || c .OidcIdpIssuerURL != "" ||
9091 c .OidcValidatorClientID != "" || c .OidcValidatorIdpIssuerURL != "" ) {
9192 return errors .New (`oidc-client-id, oidc-client-secret, oidc-idp-issuer-url, oidc-validator-client-id,
92- oidc-validator-idp-issuer-url, flags are only meant to be used in inCluster mode` )
93+ oidc-validator-idp-issuer-url, flags are only meant to be used in inCluster mode or with --oidc-use-cookie ` )
9394 }
9495
9596 // OIDC TLS verification warning.
@@ -447,6 +448,7 @@ func addOIDCFlags(f *flag.FlagSet) {
447448 f .Bool ("oidc-skip-tls-verify" , false , "Skip TLS verification for OIDC" )
448449 f .String ("oidc-ca-file" , "" , "CA file for OIDC" )
449450 f .Bool ("oidc-use-access-token" , false , "Setup oidc to pass through the access_token instead of the default id_token" )
451+ f .Bool ("oidc-use-cookie" , false , "Enable OIDC cookie usage even when not running in-cluster" )
450452 f .Bool ("oidc-use-pkce" , false , "Use PKCE (Proof Key for Code Exchange) for enhanced security in OIDC flow" )
451453 f .String ("me-username-path" , DefaultMeUsernamePath ,
452454 "Comma separated JMESPath expressions used to read username from the JWT payload" )
0 commit comments