Hi! Is there a way to have a dynamic oauth2 `intro...
# talk-oathkeeper
f
Hi! Is there a way to have a dynamic oauth2
introspection_url
based some property of the match? I tried something like this, but it gives an error that the URI is malformed when loading the config.
Copy code
[
  {
    "id": "test",
    "match": {
      "url": "<http|https>://<.*>.<http://mydomain.com/<.*|mydomain.com/<.*>>",
      "methods": ["GET", "POST", "PUT", "DELETE"]
    },
    "upstream": {
      "url": "<http://localhost:3000>"
    },
    "authenticators": [
      {
        "handler": "oauth2_introspection",
        "config": {
          "introspection_url": "<http://auth>.{{ printIndex .MatchContext.RegexpCaptureGroups 1 }}.<http://mydomain.com/oauth2/introspection|mydomain.com/oauth2/introspection>"
        }
      }
    ],
    "authorizer": {
      "handler": "allow"
    },
    "mutators": [
      {
        "handler": "header"
      }
    ],
    "errors": [
      {
        "handler": "json"
      }
    ]
  }
]
p
Hi @User You can probably use regular expressions or glob patterns. e.g.
Copy code
"introspection_url": "<http://auth>.<.*>.<http://mydomain.com/oauth2/introspection|mydomain.com/oauth2/introspection>"
or
Copy code
"introspection_url": "<http://auth>.<{foo,bar}>.<http://mydomain.com/oauth2/introspection|mydomain.com/oauth2/introspection>"
But I'm not sure if it will work on
introspection_url
.
the other option is to just have more rules that specify different introspection_urls