[Apiman-user] Using property placeholder in policy configuration which evaluate at runtime using system properties

Ton Swieb ton at finalist.nl
Wed Dec 9 11:19:37 EST 2015


Hi,

Is it possible to use property placeholders in policy configuration. The
property placeholders should be evaluated at runtime based on a Java system
property.

For example.
I have configured the realm property in the Keycloak Oauth policy to be:
http://localhost:8080/auth/realms/apiman

But instead of setting protocol://host:port hardcoded I want to use
something like:
{{protocol}}://{{host}:{port}/auth/realms/apiman
or
{{baseUrl}}/auth/realms/apiman

The reason I want to use property placeholders is because of our Docker
build.
The Docker image is setup with a preconfigured Apiman installation. So the
image already has some service published an policies applied. Only when
building the image it is unknown on which host the image will run.

In particular. The Keycloak OAuth policy is complaining as follows:

{
  "type": "Authentication",
  "failureCode": 11004,
  "responseCode": 401,
  "message": "Token audience doesn't match domain. Token issuer is
http://192.168.99.100:8080/auth/realms/apiman, but URL from
configuration is http://localhost:8080/auth/realms/apiman",
  "headers": {}
}

I hope to solve this by using property placeholders which evaluate at
runtime using a system property.

Regards,

Ton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/apiman-user/attachments/20151209/ebb7d336/attachment.html 


More information about the Apiman-user mailing list