<div dir="ltr">Hi Team,<div><br></div><div>Recently i ran into an issue where i am using signedJWT tokens as client authentication mechnaism instead of client id/secret. </div><div><br></div><div>My keyclok.json looks like this:</div><div><font face="monospace, monospace"><br></font></div><div><div><font face="monospace, monospace">  &quot;realm&quot;: &quot;nginx&quot;,</font></div><div><font face="monospace, monospace">  &quot;realm-public-key&quot;: &quot;MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzb6ecdzvU+RoI0Qu6Psh1NFKLUoSuSfoAdW/nD5sr0M1FDpLOrsRIzIRScS9DJ28n1+Kdvrad9aS/UMsr+NXHRoSPeZuabAtfDCYx49+NhtR+LW97rB4lBNnXf148mkhikyZ0B08naQlhgkAqBXR5oxOo/FqWCObhZxBPsU9BcL4Qb5JO1we8k+7kIHTFyhHbZvEAk292eIG+GyrUDh+ZyE8T8Myde0GM1Korg9ZsdYxbb3U78bmxgvBmeye+Dq89EbyNDE3K/7giq7Gmh4Gu6fVcJG9tCjl1pS7CiDH1gTuITJxSJO3bPRf58SVoId8S26/5YMIq7pqwXe/pyvAewIDAQAB&quot;,</font></div><div><font face="monospace, monospace">  &quot;auth-server-url&quot;: &quot;<a href="http://192.168.99.100:31048/auth">http://192.168.99.100:31048/auth</a>&quot;,</font></div><div><font face="monospace, monospace">  &quot;ssl-required&quot;: &quot;external&quot;,</font></div><div><font face="monospace, monospace">  &quot;resource&quot;: &quot;product-portal&quot;,</font></div><div><font face="monospace, monospace">  &quot;enable-cors&quot; : false,</font></div><div><font face="monospace, monospace">  &quot;credentials&quot;: {</font></div><div><font face="monospace, monospace">   &quot;jwt&quot;: {</font></div><div><font face="monospace, monospace">     &quot;client-key-password&quot;: &quot;changeit&quot;,</font></div><div><font face="monospace, monospace">     &quot;client-keystore-file&quot;: &quot;/keystore/keystore.jks&quot;,</font></div><div><font face="monospace, monospace">     &quot;client-keystore-password&quot;: &quot;changeit&quot;,</font></div><div><font face="monospace, monospace">     &quot;client-key-alias&quot;: &quot;product-portal&quot;,</font></div><div><font face="monospace, monospace">     &quot;token-timeout&quot;: 10,</font></div><div><font face="monospace, monospace">     &quot;client-keystore-type&quot;: &quot;jks&quot;</font></div><div><font face="monospace, monospace">    }</font></div><div><font face="monospace, monospace">  }</font></div><div>}</div><div><br></div><div><br></div><div>But when i am trying to deploy this app in my local tomcat, the app doesnt deploy and failed. I saw my catalina.log file which tells this:</div><div><br></div><div><div>12-Aug-2016 07:13:09.400 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web applicatio</div><div>n archive /usr/local/tomcat/webapps/product-portal.war</div><div> java.lang.RuntimeException: org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of java.lang.String out of STA</div><div>RT_OBJECT token</div><div> at [Source: java.io.FileInputStream@7d33dbab; line: 9, column: 5] (through reference chain: org.keycloak.representations.adapters.conf</div><div>ig.AdapterConfig[&quot;credentials&quot;])</div><div>        at org.keycloak.adapters.KeycloakDeploymentBuilder.loadAdapterConfig(KeycloakDeploymentBuilder.java:104)</div><div>        at org.keycloak.adapters.KeycloakDeploymentBuilder.build(KeycloakDeploymentBuilder.java:93)</div><div>        at org.keycloak.adapters.tomcat.AbstractKeycloakAuthenticatorValve.keycloakInit(AbstractKeycloakAuthenticatorValve.java:116)</div><div>        at org.keycloak.adapters.tomcat.AbstractKeycloakAuthenticatorValve.lifecycleEvent(AbstractKeycloakAuthenticatorValve.java:65)</div><div>        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)</div><div>        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)</div><div>        at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:394)</div><div>        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:165)</div><div>        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)</div><div>        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)</div><div>        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)</div><div>        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:940)</div><div>        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1816)</div><div>        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)</div><div>        at java.util.concurrent.FutureTask.run(FutureTask.java:262)</div><div>        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)</div><div>        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)</div><div>        at java.lang.Thread.run(Thread.java:745)</div><div>Caused by: org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of java.lang.String out of START_OBJECT token</div><div> at [Source: java.io.FileInputStream@7d33dbab; line: 9, column: 5] (through reference chain: org.keycloak.representations.adapters.conf</div><div>ig.AdapterConfig[&quot;credentials&quot;])</div><div>        at org.codehaus.jackson.map.JsonMappingException.from(JsonMappingException.java:163)</div><div>        at org.codehaus.jackson.map.deser.StdDeserializationContext.mappingException(StdDeserializationContext.java:219)</div><div>        at org.codehaus.jackson.map.deser.std.StringDeserializer.deserialize(StringDeserializer.java:44)</div><div>        at org.codehaus.jackson.map.deser.std.StringDeserializer.deserialize(StringDeserializer.java:13)</div><div>        at org.codehaus.jackson.map.deser.std.MapDeserializer._readAndBind(MapDeserializer.java:319)</div><div>        at org.codehaus.jackson.map.deser.std.MapDeserializer.deserialize(MapDeserializer.java:249)</div><div>        at org.codehaus.jackson.map.deser.std.MapDeserializer.deserialize(MapDeserializer.java:33)</div><div>        at org.codehaus.jackson.map.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:299)</div><div>        at org.codehaus.jackson.map.deser.SettableBeanProperty$MethodProperty.deserializeAndSet(SettableBeanProperty.java:414)</div><div>        at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:697)</div><div>......</div><div><br></div><div>It shows problem in &quot;credentials&quot; property to deserilize. </div><div><br></div><div>I am using Keycloak 2.0.0.Final and tomcat 8.0.36 version.</div><div>for keycloak I am using tomcat adapter for my app.</div><div><br></div><div>Please help.</div><div><br></div><div><br></div></div><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><b>- Best Regards</b></div><div><span style="font-size:12.8px">   Abhishek Raghav</span><br></div><div><div><br></div><div>

<p style="background:none 0% 0% repeat scroll white"><span style="font-size:12pt;font-family:&quot;Bookman Old Style&quot;,serif;color:rgb(34,34,34)"><br></span></p>

</div></div><br><div><br></div><div><br></div><div><br></div></div></div></div></div></div></div>
</div></div>