feat(authn-oidc): allow overwriting of cookie name
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good

This commit is contained in:
2024-06-05 16:13:45 +02:00
parent 65238f1ff3
commit 19fda6aa64
2 changed files with 8 additions and 4 deletions

View File

@ -401,8 +401,14 @@ func (a *Authenticator) getClient(options *LayerOptions, redirectURL string) (*C
return client, nil
}
const defaultCookieNamePrefix = "_bouncer_authn_oidc"
func (a *Authenticator) getCookieName(cookieName string, proxyName store.ProxyName, layerName store.LayerName) string {
return strings.ToLower(fmt.Sprintf("%s_%s_%s", cookieName, proxyName, layerName))
if cookieName != "" {
return cookieName
}
return strings.ToLower(fmt.Sprintf("%s_%s_%s", defaultCookieNamePrefix, proxyName, layerName))
}
var (