<div dir="ltr"><div><div><div>Keycloak Users,<br><br></div>I am attempting to configure Keycloak with Tomcat 8 and have deployed the following:<br><br></div>/WEB-INF/web.xml<br><web-app xmlns="<a href="http://java.sun.com/xml/ns/javaee">http://java.sun.com/xml/ns/javaee</a>"<br>xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>"<br>xsi:schemaLocation="<a href="http://java.sun.com/xml/ns/javaee">http://java.sun.com/xml/ns/javaee</a> <a href="http://java.sun.com/">http://java.sun.com/</a><br>xml/ns/javaee/web-app_3_0.xsd"<br>version="3.0"><br><module-name>customer-portal</module-name><br><security-constraint><br><web-resource-collection><br><web-resource-name>mprworktrac</web-resource-name><br><url-pattern>/mprworktrac</url-pattern><br></web-resource-collection><br><auth-constraint><br><role-name>user</role-name><br></auth-constraint><br></security-constraint><br><security-constraint><br><web-resource-collection><br><url-pattern>/mprworktrac</url-pattern><br></web-resource-collection><br><user-data-constraint><br><transport-guarantee>CONFIDENTIAL</transport-guarantee><br></user-data-constraint><br></security-constraint><br><login-config><br><auth-method>BASIC</auth-method><br><realm-name>this is ignored currently</realm-name><br></login-config><br><security-role><br><role-name>admin</role-name><br></security-role><br><security-role><br><role-name>user</role-name><br></security-role><br></web-app><br><br></div>/META-INF/content.xml<br><Context path="/mprworktrac"><br><Valve className="org.keycloak.adapters.tomcat.KeycloakAuthenticatorValve"/><br></Context><br><br><br clear="all"><div><div><div><div><div>/WEB-INF/keyloak.json<br>{<br>"realm" : "worktrac",<br>"resource" : "customer-portal",<br>"realm-public-key" : "MIGfMA0GCSqGSIb3D...31LwIDAQAB",<br>"auth-server-url" : "<a href="https://localhost:8443/auth">https://localhost:8443/auth</a>",<br>"ssl-required" : "external",<br>"use-resource-role-mappings" : false,<br>"enable-cors" : true,<br>"cors-max-age" : 1000,<br>"cors-allowed-methods" : [ "POST", "PUT", "DELETE", "GET" ],<br>"bearer-only" : false,<br>"expose-token" : true,<br>"credentials" : {<br>"secret" : "234234-234234-234234"<br>},<br>"connection-pool-size" : 20,<br>"disable-trust-manager": false,<br>"allow-any-hostname" : false,<br>"truststore" : "/opt/keycloak-appliance-dist-all-1.1.0.Final/keycloak/standalone/configuration/secret.jks",<br>"truststore-password" : "secret",<br>"client-keystore" : "/opt/keycloak-appliance-dist-all-1.1.0.Final/keycloak/standalone/configuration/secret.jks",<br>"client-keystore-password" : "secret",<br>"client-key-password" : "secret"<br>}<br><br></div><div>Extracted keycloak-tomcat8-adapter-dist-1.1.0.Final.zip to $CATALINA_HOME/lib<br></div><div><br></div><div>I receive the following in catalina.out on startup:<br>java.lang.RuntimeException: org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of java.lang.String out of START_ARRAY token<br> at [Source: java.io.FileInputStream@7ff0e2e8; line: 9, column: 22] (through reference chain: org.keycloak.representations.adapters.config.AdapterConfig["cors-allowed-methods"])<br> at org.keycloak.adapters.KeycloakDeploymentBuilder.loadAdapterConfig(KeycloakDeploymentBuilder.java:104)<br> at org.keycloak.adapters.KeycloakDeploymentBuilder.build(KeycloakDeploymentBuilder.java:93)<br> at org.keycloak.adapters.tomcat.AbstractKeycloakAuthenticatorValve.keycloakInit(AbstractKeycloakAuthenticatorValve.java:116)<br> at org.keycloak.adapters.tomcat.AbstractKeycloakAuthenticatorValve.lifecycleEvent(AbstractKeycloakAuthenticatorValve.java:65)<br> at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)<br> at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)<br> at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)<br> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:168)<br> at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)<br> at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)<br> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)<br> at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1069)<br> at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1719)<br> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)<br> at java.util.concurrent.FutureTask.run(FutureTask.java:266)<br> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)<br> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)<br> at java.lang.Thread.run(Thread.java:745)<br>Caused by: org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of java.lang.String out of START_ARRAY token<br> at [Source: java.io.FileInputStream@7ff0e2e8; line: 9, column: 22] (through reference chain: org.keycloak.representations.adapters.config.AdapterConfig["cors-allowed-methods"])<br> at org.codehaus.jackson.map.JsonMappingException.from(JsonMappingException.java:163)<br> at org.codehaus.jackson.map.deser.StdDeserializationContext.mappingException(StdDeserializationContext.java:219)<br> at org.codehaus.jackson.map.deser.std.StringDeserializer.deserialize(StringDeserializer.java:44)<br> at org.codehaus.jackson.map.deser.std.StringDeserializer.deserialize(StringDeserializer.java:13)<br> at org.codehaus.jackson.map.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:299)<br> at org.codehaus.jackson.map.deser.SettableBeanProperty$MethodProperty.deserializeAndSet(SettableBeanProperty.java:414)<br> at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:697)<br> at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:580)<br> at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2732)<br> at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1909)<br> at org.keycloak.adapters.KeycloakDeploymentBuilder.loadAdapterConfig(KeycloakDeploymentBuilder.java:102)<br> ... 17 more<br><br></div><div>Your help is greatly appreciated as I am excited to get this working :-)<br></div><div><br></div><div>-- <br><div class="gmail_signature">Chris Wallace<br><a href="mailto:cjwallac@gmail.com" target="_blank">cjwallac@gmail.com</a><br></div>
</div></div></div></div></div></div>