<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">It seems that you're using some quite
      old adapter version on Tomcat side. Could you try to update to
      latest Keycloak adapter in your Tomcat as well?<br>
      <br>
      Marek<br>
      <br>
      On 12/08/16 09:44, abhishek raghav wrote:<br>
    </div>
    <blockquote
cite="mid:CAJmz6fucC2udg-puJVjUC4iZwvGyHk63BUsEPC9FrJH1MRXuVw@mail.gmail.com"
      type="cite">
      <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">  "realm": "nginx",</font></div>
          <div><font face="monospace, monospace">  "realm-public-key":
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzb6ecdzvU+RoI0Qu6Psh1NFKLUoSuSfoAdW/nD5sr0M1FDpLOrsRIzIRScS9DJ28n1+Kdvrad9aS/UMsr+NXHRoSPeZuabAtfDCYx49+NhtR+LW97rB4lBNnXf148mkhikyZ0B08naQlhgkAqBXR5oxOo/FqWCObhZxBPsU9BcL4Qb5JO1we8k+7kIHTFyhHbZvEAk292eIG+GyrUDh+ZyE8T8Myde0GM1Korg9ZsdYxbb3U78bmxgvBmeye+Dq89EbyNDE3K/7giq7Gmh4Gu6fVcJG9tCjl1pS7CiDH1gTuITJxSJO3bPRf58SVoId8S26/5YMIq7pqwXe/pyvAewIDAQAB",</font></div>
          <div><font face="monospace, monospace">  "auth-server-url": "<a
                moz-do-not-send="true"
                href="http://192.168.99.100:31048/auth"><a class="moz-txt-link-freetext" href="http://192.168.99.100:31048/auth">http://192.168.99.100:31048/auth</a></a>",</font></div>
          <div><font face="monospace, monospace">  "ssl-required":
              "external",</font></div>
          <div><font face="monospace, monospace">  "resource":
              "product-portal",</font></div>
          <div><font face="monospace, monospace">  "enable-cors" :
              false,</font></div>
          <div><font face="monospace, monospace">  "credentials": {</font></div>
          <div><font face="monospace, monospace">   "jwt": {</font></div>
          <div><font face="monospace, monospace">   
               "client-key-password": "changeit",</font></div>
          <div><font face="monospace, monospace">   
               "client-keystore-file": "/keystore/keystore.jks",</font></div>
          <div><font face="monospace, monospace">   
               "client-keystore-password": "changeit",</font></div>
          <div><font face="monospace, monospace">   
               "client-key-alias": "product-portal",</font></div>
          <div><font face="monospace, monospace">     "token-timeout":
              10,</font></div>
          <div><font face="monospace, monospace">   
               "client-keystore-type": "jks"</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["credentials"])</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["credentials"])</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 "credentials" 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>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
keycloak-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/keycloak-user">https://lists.jboss.org/mailman/listinfo/keycloak-user</a></pre>
    </blockquote>
    <br>
  </body>
</html>