outposts/proxy: add additional headers

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-12-01 20:19:09 +01:00
parent 382b0e8941
commit 60b95271eb
4 changed files with 55 additions and 9 deletions

View File

@ -24,6 +24,11 @@ func (a *Application) addHeaders(headers http.Header, c *Claims) {
headers.Set("X-authentik-name", c.Name)
headers.Set("X-authentik-uid", c.Sub)
// System headers
headers.Set("X-authentik-meta-outpost", a.outpostName)
headers.Set("X-authentik-meta-provider", a.proxyConfig.Name)
headers.Set("X-authentik-meta-app", a.proxyConfig.AssignedApplicationSlug)
userAttributes := c.Proxy.UserAttributes
// Attempt to set basic auth based on user's attributes
if *a.proxyConfig.BasicAuthEnabled {