[keycloak-user] Realm.toRepresentation results in com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException

Dmitry Telegin dt at acutus.pro
Fri Jan 4 09:40:51 EST 2019


Hello Andreas,

Could it be that you're using older (pre-4.1.0) Java admin client against newer Keycloak? The field "offlineSessionMaxLifespanEnabled" has been introduced in Keycloak 4.1.0.

Please also try the same with kcadm.sh:

bin/kcadm.sh get realms/myrealm > myrealm.json
(edit myrealm.json)
bin/kcadm.sh update realms/myrealm -f myrealm.json

Does that work?

Cheers,
Dmitry Telegin
CTO, Acutus s.r.o.
Keycloak Consulting and Training

Pod lipami street 339/52, 130 00 Prague 3, Czech Republic
+42 (022) 888-30-71
E-mail: info at acutus.pro

On Fri, 2019-01-04 at 12:49 +0100, Andreas Lau wrote:
> Hey me again, since nobody seams to be able to help me, I thought, maybe
> it's due to the fact I didn't explain well enough what I try to do?
> So I try to clarify a bit more in deep what I like achieve.
> I'm using the keycloak client API to update some parts of the realm. To do
> this I followed the test
> https://github.com/keycloak/keycloak/blob/master/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/realm/RealmTest.java
> 
> There is a simple example "public void renameRealmTest()"  that retrieves a
> realm, transforms it to its representation and finally renames and updates
> it.  This describes the work flow I try to follow. But doing this I results
> in the mentioned exception "UnrecognizedPropertyException" from jackson.
> 
> At this point I ask for help because I think the test will be executed
> before shipping keycloak by the way I'm using the 4.5 version.
> 
> So can you please help me to find the error or give me some hints that help
> me to understand why the exception appears?
> 
> Thanks
> 
> Am Do., 27. Dez. 2018, 12:40 hat Andreas Lau <totheocean0402 at gmail.com>
> geschrieben:
> 
> > Sorry for bouncing this up again. But I'm a bit stuck Ed on the problem.
> > Can anyone help me out? Is this the right list for this?
> > 
> > Thanks
> > 
> > Am Mi., 19. Dez. 2018, 18:04 hat Frank Franz <totheocean0402 at gmail.com>
> > geschrieben:
> > 
> > > Hello,
> > > I'm using the java admin client to create a realm and some other setting.
> > > In this process I like to update the realm (set authentication bindings for
> > > registration flow and credential flow) therefore I from my actual knowledge
> > > have to transfer the realm to the realm representation.
> > > 
> > > Doing this calling realm.toRepresentation() results in the following
> > > error:
> > > javax.ws.rs.client.ResponseProcessingException: javax.ws.rs.
> > > ProcessingException: com.fasterxml.jackson.databind.exc.
> > > UnrecognizedPropertyException: Unrecognized field "
> > > offlineSessionMaxLifespanEnabled" (class org.keycloak.representations.idm
> > > .RealmRepresentation), not marked as ignorable (101 known properties: "
> > > directGrantFlow", "otpPolicyDigits", "identityProviderMappers", "
> > > revokeRefreshToken", "identityProviders", "userFederationMappers", "
> > > rememberMe", "duplicateEmailsAllowed", "dockerAuthenticationFlow", "
> > > otpSupportedApplications", "adminEventsDetailsEnabled", "registrationFlow",
> > > "editUsernameAllowed", "clients", "users", "emailTheme", "realm", "
> > > actionTokenGeneratedByAdminLifespan", "authenticatorConfig",
> > > "components", "certificate", "updateProfileOnInitialSocialLogin", "
> > > otpPolicyType", "accessCodeLifespanUserAction", "protocolMappers", "id",
> > > "accountTheme", "maxDeltaTimeSeconds", "enabledEventTypes", "verifyEmail",
> > > "applications", "waitIncrementSeconds", "eventsListeners", "
> > > eventsExpiration", "defaultDefaultClientScopes", "
> > > defaultOptionalClientScopes", "passwordPolicy", "clientTemplates", "
> > > registrationAllowed", "userManagedAccessAllowed", "notBefore", "
> > > otpPolicyAlgorithm", "actionTokenGeneratedByUserLifespan", "
> > > permanentLockout", "socialProviders", "otpPolicyInitialCounter"
> > > [truncated]])
> > > 
> > > Can you pleas give me a hint how to resolve this?
> > > Thanks in advance.
> > > Andreas
> > > 
> 
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user


More information about the keycloak-user mailing list