[keycloak-dev] Propagating system props to keycloak.json on WildFly
Tomas Kyjovsky
tkyjovsk at redhat.com
Tue Jun 16 07:17:33 EDT 2015
----- Original Message -----
>
>
> ----- Original Message -----
> > From: "Tomas Kyjovsky" <tkyjovsk at redhat.com>
> > To: keycloak-dev at lists.jboss.org
> > Sent: Monday, 15 June, 2015 7:14:03 PM
> > Subject: [keycloak-dev] Propagating system props to keycloak.json on
> > WildFly
> >
> > While working on arquillian adapter tests I hit a problem when deploying
> > some
> > of the test servlets to standalone WF.
> >
> > The original AdapterTest sets some system props that are later used by
> > "session-portal" and "input-portal": [1-3].
> >
> > AdapterTest.java:
> > // Test that replacing system properties works for adapters
> > System.setProperty("app.server.base.url", "http://localhost:8081");
> > System.setProperty("my.host.name", "localhost");
> >
> > App's keycloak.json:
> > "auth-server-url" : "http://${my.host.name}:8081/auth",
> >
> >
> > While this works on embedded container, with a standalone WF I get this
> > error
> > during deployment:
> >
> > IllegalArgumentException: Illegal character in authority at index 7:
> > http://${my.host.name}:8180/auth
> >
> > Any ideas on how to proceed?
> > Do I just need to set the actual values in keycloak.json before test as it
> > is
> > done for the other test apps?
>
> Yes, if I remember correctly if the sys prop doesn't exist it just leaves it
> alone (and http://${my.host.name}:8180/auth isn't a valid url).
>
> Actually, we need to make sure that this test (or another test) uses this
> property as that's a feature of keycloak.json that you can refer to sys
> props and env variables.
Problem was on my side - I passed the system props to the wrong container (keycloak server instead of the app server). I fixed it and it works fine now.
>
> >
> >
> > Regards,
> > Tomas
> >
> >
> > [1]
> > https://github.com/keycloak/keycloak/blob/master/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/AdapterTest.java#L81
> > [2]
> > https://github.com/keycloak/keycloak/blob/master/testsuite/integration/src/test/resources/adapter-test/session-keycloak.json#L5
> > [3]
> > https://github.com/keycloak/keycloak/blob/master/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/InputServlet.java#L18
> > _______________________________________________
> > keycloak-dev mailing list
> > keycloak-dev at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/keycloak-dev
>
More information about the keycloak-dev
mailing list