How to use headers?

Hello,

I want to use a header from the request to call an hydrator service but the header is null.
How to have something in the headers ?

Another question, I would prefer to use $1 from the request in my hydrator but I didn’t find how to do this, that’s why I wanted to use header, but without success.

Thanks,

Could you provide the example config you’re trying to get working?

This is my global config

...
   mutators:
      noop:
        enabled: true
      id_token:
        enabled: true
        config:
          issuer_url: https://internal-etp/
          jwks_url: file:///etc/secrets/mutator.id_token.jwks.json
          ttl: 60m
      hydrator:
        enabled: true
        config:
          api:
            url: http://idcp/ory/extra

And the rule I want to use :

{
        "id": "enriched",
        "match": {
            "url": "<http|https>://127.0.0.1:4456/mutator/<.*>/<.*>",
            "methods": [
                "GET",
                "POST"
            ]
        },
        "authenticators": [
            {
                "handler": "jwt",
                "config": {
                    "target_audience": [
                        "api://110c1548-3c9d-46a4-bbfe-12491f1696aa"
                    ]
                }
            }
        ],
        "authorizer": {
            "handler": "allow"
        },
        "mutators": [
            {
                "handler": "hydrator"
            },
            {
                "handler": "id_token",
                "config": {
                    "claims": "{\"appid\": \"{{ print .Extra.appid }}\", \"scp\": \"{{ print .Extra.scope }}\", \"tenant\": \"{{ print .Extra.tenant }}\", \"resourceGroup\": \"{{ print .Extra.resourceGroup }}\"}"
                }
            }
        ]
    }

I do this request

GET http://127.0.0.1:4456/decisions/mutator/test/datas
With this header:
scope : c00562bc-7101-4a62-8500-e980de3951fd

But I don’t receive this header in my service http://idcp/ory/extra.

Ok I checked the code and the request headers are not in the authentication context but in the hydrator request headers.

It could be the interesting to have them in the context instead of the request.