silly-vegetable-17473
08/08/2022, 4:33 AMauthenticator
response and setting an X-User
in the header but while I set some other header i.e., extra
it is somehow attaching the value of sub
again in front of the extra.
Here is an example:
So, my response structure is something like this:
{
"aud": [],
"auth_time": 0,
"identity": {},
"sub": "string",
}
The expected response is the above, just in map or string format. However, I am getting the below response in X-SomeData
:
“x-somedata”: “&{<mailto:test-mail@abc.com|test-mail@abc.com>
map[aud:[4ad17a4f-6c5b-4c93-bfe0-7b8bed973811] auth_time:1.657257973e+09 sub:<mailto:test-mail@abc.com|test-mail@abc.com>
identity:map[Some data
] }“,
Here is my config for oathkeeper:
mutators:
header:
enabled: true
config:
headers:
X-SomeData: '{{ print .}}'
authorizers:
allow:
enabled: true
deny:
enabled: true
authenticators:
bearer_token:
enabled: true
config:
check_session_url: <https://localdomain:8099>
anonymous:
enabled: true
config:
subject: guest
Below is the other config for forwarding:
authenticators:
- handler: bearer_token
config:
check_session_url: <http://localdomain:8099/v1/verify/token>
preserve_path: true
extra_from: "@this"
authorizer:
handler: allow
mutators:
- handler: header
Have I missed something from the documentation which is affecting this format?