outposts/proxy: add additional headers
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
cf78c89830
commit
347c3793fc
|
@ -13,4 +13,6 @@ type Claims struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
PreferredUsername string `json:"preferred_username"`
|
PreferredUsername string `json:"preferred_username"`
|
||||||
Groups []string `json:"groups"`
|
Groups []string `json:"groups"`
|
||||||
|
|
||||||
|
RawToken string
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,8 +25,10 @@ func (a *Application) addHeaders(headers http.Header, c *Claims) {
|
||||||
headers.Set("X-authentik-email", c.Email)
|
headers.Set("X-authentik-email", c.Email)
|
||||||
headers.Set("X-authentik-name", c.Name)
|
headers.Set("X-authentik-name", c.Name)
|
||||||
headers.Set("X-authentik-uid", c.Sub)
|
headers.Set("X-authentik-uid", c.Sub)
|
||||||
|
headers.Set("X-authentik-jwt", c.RawToken)
|
||||||
|
|
||||||
// System headers
|
// System headers
|
||||||
|
headers.Set("X-authentik-meta-jwks", a.proxyConfig.OidcConfiguration.JwksUri)
|
||||||
headers.Set("X-authentik-meta-outpost", a.outpostName)
|
headers.Set("X-authentik-meta-outpost", a.outpostName)
|
||||||
headers.Set("X-authentik-meta-provider", a.proxyConfig.Name)
|
headers.Set("X-authentik-meta-provider", a.proxyConfig.Name)
|
||||||
headers.Set("X-authentik-meta-app", a.proxyConfig.AssignedApplicationSlug)
|
headers.Set("X-authentik-meta-app", a.proxyConfig.AssignedApplicationSlug)
|
||||||
|
|
|
@ -45,5 +45,6 @@ func (a *Application) redeemCallback(r *http.Request, shouldState string) (*Clai
|
||||||
if err := idToken.Claims(&claims); err != nil {
|
if err := idToken.Claims(&claims); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
claims.RawToken = rawIDToken
|
||||||
return claims, nil
|
return claims, nil
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue