Hi everyone, do you know if RegexpCaptureGroups ca...
# talk-oathkeeper
f
Hi everyone, do you know if RegexpCaptureGroups can be used in authenticator config in the access rules? I have a rule that look like this aiming to enforce JWT’s audience to match the requested domain. However the RegexpCaptureGroups reference didn’t render (cause of the error) and get printed out literally in the log.
Copy code
{
    "id": "protected_resources",
    "version": "v0.40.6",
    "match": {
      "url": "<http|https>://<.*>/<playground|query|anything/header>",
      "methods": [
        "GET",
        "POST"
      ]
    },
    "authenticators": [
      {
        "handler": "jwt",
        "config": {
          "target_audience": [
            "{{ printIndex .MatchContext.RegexpCaptureGroups 0 }}://{{ printIndex .MatchContext.RegexpCaptureGroups 1 }}"
          ]
        }
      }
    ],
Error in log:
Copy code
"reason": "id=\nrid=\nerror=The request could not be authorized\nreason=Token audience [<https://my.domain.com>] is not intended for target audience {{ printIndex .MatchContext.RegexpCaptureGroups 0 }}://{{ printIndex .MatchContext.RegexpCaptureGroups 1 }}