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

Eric Wittmann eric.wittmann at redhat.com
Wed Dec 9 11:35:04 EST 2015


Unfortunately that isn't currently supported.  However it would be a 
relatively simple feature to add.  Perhaps you could submit a JIRA 
feature request?  If you do I'm sure we can have that included in 
1.2.0.Final (due by the end of the month).

-Eric

On 12/9/2015 11:19 AM, Ton Swieb wrote:
> 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 ishttp://192.168.99.100:8080/auth/realms/apiman, but URL from configuration ishttp://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
>
>
>
>
> _______________________________________________
> Apiman-user mailing list
> Apiman-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/apiman-user
>


More information about the Apiman-user mailing list