<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10px"><div id="yui_3_16_0_1_1414609631777_4407">Hi Alexander,</div><div id="yui_3_16_0_1_1414609631777_4406" dir="ltr"> On a second look, my problem was with my tomcat application that integrates with Keycloak. This tomcat application was using fasterxml jackson parser whereas keycloak implementation uses codehaus jackson which gets overridden during runtime. I was able to overcome this problem by creating PropertyNamingStrategy and set it to ObjectMapper before deserializing the JSON.</div><div id="yui_3_16_0_1_1414609631777_4405" dir="ltr"><br></div><div id="yui_3_16_0_1_1414609631777_4408" dir="ltr">Alternatively Keycloak implementation can be modified to use fasterxml jackson databinding.</div><div id="yui_3_16_0_1_1414609631777_4409" dir="ltr"><br></div><div id="yui_3_16_0_1_1414609631777_4410" dir="ltr">-Kamal<br></div><div id="yui_3_16_0_1_1414609631777_4345"><span></span></div><br> <div id="yui_3_16_0_1_1414609631777_4348" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 10px;"> <div id="yui_3_16_0_1_1414609631777_4347" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div id="yui_3_16_0_1_1414609631777_4346" dir="ltr"> <hr size="1"> <font face="Arial" size="2"> <b><span style="font-weight:bold;">From:</span></b> Alexander Chriztopher <alexander.chriztopher@gmail.com><br> <b><span style="font-weight: bold;">To:</span></b> Kamal Jagadevan <j.kamal@ymail.com> <br><b><span style="font-weight: bold;">Cc:</span></b> "keycloak-user@lists.jboss.org" <keycloak-user@lists.jboss.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Monday, October 27, 2014 12:54 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [keycloak-user] Java API documentation<br> </font> </div> <div class="y_msg_container"><br><div id="yiv0110252038"><div><div dir="ltr"><div>Hi Kamal and thanks.</div><div><br clear="none"></div><div>Am using the keycloak admin client which brings the following Jackson dependency : jackson-core-asl:1.9.9 and can not override this. I also don't have the option to change the property mapping as it comes with the Keycloak distribution am using :-(</div></div><div class="qtdSeparateBR"><br><br></div><div class="yiv0110252038yqt2091702976" id="yiv0110252038yqt55259"><div class="yiv0110252038gmail_extra"><br clear="none"><div class="yiv0110252038gmail_quote">On Mon, Oct 27, 2014 at 4:54 PM, Kamal Jagadevan <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:j.kamal@ymail.com" target="_blank" href="mailto:j.kamal@ymail.com">j.kamal@ymail.com</a>></span> wrote:<br clear="none"><blockquote class="yiv0110252038gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="color:rgb(0,0,0);font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10px;background-color:rgb(255,255,255);"><div>Hi Alexander,</div><div dir="ltr"> I had faced the same problem few days back it is because of the mismatch between JSONProperty and POJO variable name(getter method) that too with fasterxml jackson parser.</div><div dir="ltr">If you use codehaus jackson parser you wouldnt get any problem. One work around to this problem is to update the POJO variable name to reflect the JSONProperty name.</div><div dir="ltr">Similar problem is observed in multiple places where deserialization kicks in..<br clear="none"></div><div dir="ltr"><br clear="none"></div><div dir="ltr">Specifically it is because of this</div><div dir="ltr"><br clear="none"></div><div dir="ltr"> @JsonProperty("<b>access_token</b>")<br clear="none"> protected String <b>token</b>;<br clear="none"></div><div dir="ltr"><br clear="none"></div><div dir="ltr">Hi Bill,</div><div dir="ltr"> Do you have any other ideas besides updating POJOs member variable name matching the JSON property? Please advise.</div><div dir="ltr"><br clear="none"></div><div dir="ltr">Thanks</div><div dir="ltr">Kamal<br clear="none"></div><div dir="ltr"> <br clear="none"></div><div><span></span></div><br clear="none"> <div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10px;"> <div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"> <div dir="ltr"> <hr size="1"> <font face="Arial"> <b><span style="font-weight:bold;">From:</span></b> Alexander Chriztopher <<a rel="nofollow" shape="rect" ymailto="mailto:alexander.chriztopher@gmail.com" target="_blank" href="mailto:alexander.chriztopher@gmail.com">alexander.chriztopher@gmail.com</a>><br clear="none"> <b><span style="font-weight:bold;">To:</span></b> "<a rel="nofollow" shape="rect" ymailto="mailto:keycloak-user@lists.jboss.org" target="_blank" href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a>" <<a rel="nofollow" shape="rect" ymailto="mailto:keycloak-user@lists.jboss.org" target="_blank" href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a>> <br clear="none"> <b><span style="font-weight:bold;">Sent:</span></b> Monday, October 27, 2014 11:45 AM<br clear="none"> <b><span style="font-weight:bold;">Subject:</span></b> [keycloak-user] Java API documentation<br clear="none"> </font> </div> <div><div><div class="yiv0110252038h5"><br clear="none"><div><div dir="ltr"><div>Hi All,</div><div> </div><div>Am using Keycloak 1.0.2.Final and am getting this error when using the rest API :</div><div> </div><div><div align="LEFT"><font>Caused by: </font><u><font color="#0066cc"><font color="#0066cc">com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException</font></font></u><font>: Unrecognized field "access_token" (class org.keycloak.representations.AccessTokenResponse), not marked as ignorable (7 known properties: "tokenType", "notBeforePolicy", "token", "expiresIn", "sessionState", "refreshToken", "idToken"])</font></div><font>
</font><div align="LEFT"> at [Source: org.apache.http.conn.EofSensorInputStream@11b8a95d; line: 1, column: 18] (through reference chain: org.keycloak.representations.AccessTokenResponse["access_token"])</div>
<div align="LEFT"><font>        at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(</font><u><font color="#0066cc"><font color="#0066cc">UnrecognizedPropertyException.java:51</font></font></u><font>) [jackson-databind-2.3.2.jar:2.3.2]</font></div><font>
</font><div align="LEFT"><font>        at com.fasterxml.jackson.databind.DeserializationContext.reportUnknownProperty(</font><u><font color="#0066cc"><font color="#0066cc">DeserializationContext.java:671</font></font></u><font>) [jackson-databind-2.3.2.jar:2.3.2]</font></div><font>
</font><div align="LEFT"><font>        at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(</font><u><font color="#0066cc"><font color="#0066cc">StdDeserializer.java:771</font></font></u><font>) [jackson-databind-2.3.2.jar:2.3.2]</font></div><font>
</font><div align="LEFT"><font>        at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(</font><u><font color="#0066cc"><font color="#0066cc">BeanDeserializerBase.java:1297</font></font></u><font>) [jackson-databind-2.3.2.jar:2.3.2]</font></div><font>
</font><div align="LEFT"><font>        at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(</font><u><font color="#0066cc"><font color="#0066cc">BeanDeserializerBase.java:1275</font></font></u><font>) [jackson-databind-2.3.2.jar:2.3.2]</font></div><font>
</font><div align="LEFT"><font>        at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(</font><u><font color="#0066cc"><font color="#0066cc">BeanDeserializer.java:247</font></font></u><font>) [jackson-databind-2.3.2.jar:2.3.2]</font></div><font>
</font><div align="LEFT"><font>        at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(</font><u><font color="#0066cc"><font color="#0066cc">BeanDeserializer.java:118</font></font></u><font>) [jackson-databind-2.3.2.jar:2.3.2]</font></div><font>
</font><div align="LEFT"><font>        at com.fasterxml.jackson.databind.ObjectReader._bind(</font><u><font color="#0066cc"><font color="#0066cc">ObjectReader.java:1233</font></font></u><font>) [jackson-databind-2.3.2.jar:2.3.2]</font></div><font>
</font><div align="LEFT"><font>        at com.fasterxml.jackson.databind.ObjectReader.readValue(</font><u><font color="#0066cc"><font color="#0066cc">ObjectReader.java:677</font></font></u><font>) [jackson-databind-2.3.2.jar:2.3.2]</font></div><font>
</font><div align="LEFT"><font>        at org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider.readFrom(</font><u><font color="#0066cc"><font color="#0066cc">ResteasyJackson2Provider.java:120</font></font></u><font>) [resteasy-jackson2-provider-3.0.8.Final.jar:]</font></div><font>
</font><div align="LEFT"><font>        at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.readFrom(</font><u><font color="#0066cc"><font color="#0066cc">AbstractReaderInterceptorContext.java:59</font></font></u><font>) [resteasy-jaxrs-3.0.8.Final.jar:]</font></div><font>
</font><div align="LEFT"><font>        at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(</font><u><font color="#0066cc"><font color="#0066cc">AbstractReaderInterceptorContext.java:51</font></font></u><font>) [resteasy-jaxrs-3.0.8.Final.jar:]</font></div><font>
</font><div align="LEFT"><font>        at org.jboss.resteasy.security.doseta.DigitalVerificationInterceptor.aroundReadFrom(</font><u><font color="#0066cc"><font color="#0066cc">DigitalVerificationInterceptor.java:32</font></font></u><font>) [resteasy-crypto-3.0.8.Final.jar:]</font></div><font>
</font><div align="LEFT"><font>        at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(</font><u><font color="#0066cc"><font color="#0066cc">AbstractReaderInterceptorContext.java:53</font></font></u><font>) [resteasy-jaxrs-3.0.8.Final.jar:]</font></div><font>
</font><div align="LEFT"><font>        at org.jboss.resteasy.plugins.interceptors.encoding.GZIPDecodingInterceptor.aroundReadFrom(</font><u><font color="#0066cc"><font color="#0066cc">GZIPDecodingInterceptor.java:59</font></font></u><font>) [resteasy-jaxrs-3.0.8.Final.jar:]</font></div><font>
</font><div align="LEFT"><font>        at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(</font><u><font color="#0066cc"><font color="#0066cc">AbstractReaderInterceptorContext.java:53</font></font></u><font>) [resteasy-jaxrs-3.0.8.Final.jar:]</font></div><font>
</font><div align="LEFT"><font>        at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.readFrom(</font><u><font color="#0066cc"><font color="#0066cc">ClientResponse.java:248</font></font></u><font>) [resteasy-client-3.0.8.Final.jar:]</font></div><font>
</font><div>        ... 164 more</div></div><div><br clear="none"></div><div>Was wondering where this comes from as am using the 1.0.2.Final admin api and have updated my Wildfly Server accordingly.</div></div></div><br clear="none"></div></div>_______________________________________________<br clear="none">keycloak-user mailing list<br clear="none"><a rel="nofollow" shape="rect" ymailto="mailto:keycloak-user@lists.jboss.org" target="_blank" href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="https://lists.jboss.org/mailman/listinfo/keycloak-user">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br clear="none"><br clear="none"></div> </div> </div> </div></div></blockquote></div><br clear="none"></div></div></div></div><br><br></div> </div> </div> </div></body></html>