[keycloak-user] ENV in keycloak.json does not seem to be working, base64 errors

Bruno Oliveira bruno at abstractj.org
Tue May 17 11:12:40 EDT 2016


Hi, try something like this:

- At your standalone.xml add:

<system-properties>
        <property name="KC_AUTH_SERVER_URL" value="/auth"/>
</system-properties>

- keycloak.json

{
   "realm": "myrealm",
   "realm-public-key": "${KC_REALM_PUBLIC_KEY}",
   "auth-server-url": "${KC_AUTH_SERVER_URL}",
   "ssl-required": "none",
   "resource": "myrealm",
   "public-client": true
}

I hope it helps.


On 2016-05-16, cen wrote:
> Hi
>
> I am trying to use env vars in keycloak.json but I am getting base64 errors.
>
> My keycloak.json:
> {
>   "realm": "myrealm",
>   "realm-public-key": "${env.KC_REALM_PUBLIC_KEY}",
>   "auth-server-url": "${env.KC_AUTH_SERVER_URL}",
>   "ssl-required": "none",
>   "resource": "myrealm",
>   "public-client": true
> }
>
> I am deploying my ear to WildFly 10 using the following properties:
> <property name="KC_REALM_PUBLIC_KEY" value="public key here"/>
> <property name="KC_AUTH_SERVER_URL" value="http://localhost:8080/auth"/>
>
> Error on deploy:
> Bad Base64 input character decimal 36 in array position 0.. (char 36 is $)
>
> It seems that KC wants to parse the value as string instead of trying to
> resolve the env variable. Looking through the code and commits
> (https://issues.jboss.org/browse/KEYCLOAK-1289) this should work. What
> am I doing wrong?
>




> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user


--

abstractj
PGP: 0x84DC9914


More information about the keycloak-user mailing list