![dependabot[bot]](/assets/img/avatar_default.png)
* website: Bump prettier from 3.3.3 to 3.4.1 in /website Bumps [prettier](https://github.com/prettier/prettier) from 3.3.3 to 3.4.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/3.3.3...3.4.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * update formatting Signed-off-by: Jens Langhammer <jens@goauthentik.io> * sigh Signed-off-by: Jens Langhammer <jens@goauthentik.io> * disable flaky test Signed-off-by: Jens Langhammer <jens@goauthentik.io> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Jens Langhammer <jens@goauthentik.io> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jens Langhammer <jens@goauthentik.io>
42 lines
1.1 KiB
Markdown
42 lines
1.1 KiB
Markdown
---
|
|
title: Custom headers
|
|
---
|
|
|
|
The proxy can send custom headers to your upstream application. These can be configured in one of two ways:
|
|
|
|
- Group attributes; this allows for inheritance, but only allows static values
|
|
- Property mappings; this allows for dynamic values
|
|
|
|
## Group attributes
|
|
|
|
Edit the group or user you wish the header to be set for, and set these attributes:
|
|
|
|
```yaml
|
|
additionalHeaders:
|
|
X-My-Header: value
|
|
```
|
|
|
|
You can the add users to this group or override the field in users.
|
|
|
|
## Property Mappings
|
|
|
|
For dynamic Header values (for example, your application requires X-App-User to contain the username), property mappings can be used.
|
|
|
|
Create a new Scope mapping with a name and scope of your choice, and use an expression like this:
|
|
|
|
```python
|
|
return {
|
|
"ak_proxy": {
|
|
"user_attributes": {
|
|
"additionalHeaders": {
|
|
"X-App-User": request.user.username
|
|
}
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
After you've created this Scope mapping, make sure to edit the proxy provider and select the mapping.
|
|
|
|
As you can see by the similar structure, this just overrides any static attributes, so both of these methods can be combined.
|