By: Carl Buxbaum user 16 May 2016 at 8:50 a.m. CDT

3 Responses
Carl Buxbaum gravatar
Hi, When running this code: String domain = props.getProperty(SCIMProperties.DOMAIN); String umaMetaDataUrl = props.getProperty(SCIMProperties.UMA_META_DATA_URL); String umaAatClientId = props.getProperty(SCIMProperties.UMA_AAT_CLIENT_ID); // can pass in the jwks data as a String, or refer to the file location String jwksFile = props.getProperty(SCIMProperties.UMA_AAT_JWKS_FILE); String umaAatClientJwksData = props.getProperty(SCIMProperties.UMA_AAT_CLIENT_JWKS_DATA); if (umaAatClientJwksData==null) { umaAatClientJwksData=FileUtils.readFileToString(new File(jwksFile)); } String umaAatClientKeyId = props.getProperty(SCIMProperties.UMA_AAT_CLIENT_KEY_ID, ""); Scim2Client client = Scim2Client.umaInstance(domain, umaMetaDataUrl, umaAatClientId, umaAatClientJwksData, umaAatClientKeyId); // TODO Auto-generated method stub ScimResponse response = client.personSearch(attributeName, attributeValue, MediaType.APPLICATION_JSON); ObjectMapper mapper = new ObjectMapper(); mapper.configure(Feature.IGNORE_UNKNOWN, true); ListResponse listResponse = mapper.readValue(response.getResponseBodyString(),ListResponse.class); I get the following exception when I try to map the response from personSearch: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "id" (class org.gluu.oxtrust.model.scim2.ListResponse), not marked as ignorable (5 known properties: "startIndex", "totalResults", "schemas", "resources", "itemsPerPage"]) at [Source: {"id":"@!EF28.78F4.1E35.23CC!0001!68FA.BC88!0000!E857.351D","externalId":"cbuxbaum26","meta":{"created":null,"lastModified":null,"location":"/v2/Users/@!EF28.78F4.1E35.23CC!0001!68FA.BC88!0000!E857.351D","version":null,"attributes":[],"resourceType":"User"},"schemas":["urn:ietf:params:scim:schemas:core:2.0:User","urn:ietf:params:scim:schemas:extension:gluu:2.0:User"],"userName":"cbuxbaum26","name":{"formatted":null,"familyName":"Buxbaum","givenName":"Carl","middleName":null,"honorificPrefix":null,"honorificSuffix":null},"displayName":"Carlos Buxbaumus","nickName":null,"profileUrl":null,"title":null,"userType":null,"preferredLanguage":null,"locale":null,"timezone":null,"active":true,"password":"Hidden for Privacy Reasons","emails":[{"operation":null,"value":"cbuxbaum26@bamboorose.com","display":null,"primary":true,"type":"work"},{"operation":null,"value":"buxbaums1@verizon.net","display":null,"primary":false,"type":"home"}],"phoneNumbers":[],"ims":[],"photos":[],"addresses":[{"operation":null,"primary":true,"formatted":null,"streetAddress":"17 Rogers Street","locality":"Gloucester","region":"MA","postalCode":"01930","country":"US","type":null}],"groups":[],"entitlements":[],"roles":[],"x509Certificates":[],"urn:ietf:params:scim:schemas:extension:gluu:2.0:User":{"BRmail":"cbuxbaum26@bamboorose.com"}}; line: 1, column: 8] (through reference chain: org.gluu.oxtrust.model.scim2.ListResponse["id"]) I have tried mapping to various objects (User, User[], etc.) with no success. Which object am I supposed to map to, and is it implemented correctly with the proper Jackson annotations? Thanks, Carl

By Valentino Pecaoco user 16 May 2016 at 9:27 a.m. CDT

Valentino Pecaoco gravatar
Hi Carl, You can use [https://github.com/GluuFederation/SCIM-Client/blob/master/src/test/java/gluu/scim2/client/UserExtensionsPersonTest.java#L212](https://github.com/GluuFederation/SCIM-Client/blob/master/src/test/java/gluu/scim2/client/UserExtensionsPersonTest.java#L212) [https://github.com/GluuFederation/SCIM-Client/blob/master/src/test/java/gluu/scim2/client/UserExtensionsPersonTest.java#L194](https://github.com/GluuFederation/SCIM-Client/blob/master/src/test/java/gluu/scim2/client/UserExtensionsPersonTest.java#L194) In the upcoming Gluu CE / SCIM-Client v2.4.4, a custom deserializer will be provided. [https://github.com/GluuFederation/SCIM-Client/issues/16](https://github.com/GluuFederation/SCIM-Client/issues/16)

By Carl Buxbaum user 16 May 2016 at 9:28 a.m. CDT

Carl Buxbaum gravatar
Hi, I have answered my own question. After looking at your Scim2 Client test classes, I switched to codehaus from fasterxml, and added this to all of the ObjectMapper instances: mapper.disable(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES); Also, personSearch returns a single User, whereas I thought from the contract that it ought to return a list (if the attribute being searched was duplicated among User objects). Thanks, Carl

By Valentino Pecaoco user 16 May 2016 at 9:48 a.m. CDT

Valentino Pecaoco gravatar
Yes, Scim2Client.personSearch() only returns a single User. [https://github.com/GluuFederation/SCIM-Client/blob/version_2.4.3/src/main/java/gluu/scim2/client/BaseScim2ClientImpl.java#L1102](https://github.com/GluuFederation/SCIM-Client/blob/version_2.4.3/src/main/java/gluu/scim2/client/BaseScim2ClientImpl.java#L1102) [https://github.com/GluuFederation/oxTrust/blob/version_2.4.3/server/src/main/java/org/gluu/oxtrust/ws/rs/scim2/UserWebService.java#L327](https://github.com/GluuFederation/oxTrust/blob/version_2.4.3/server/src/main/java/org/gluu/oxtrust/ws/rs/scim2/UserWebService.java#L327) It is Scim2Client.retrieveAllPersons() / listUsers that return a list. [https://github.com/GluuFederation/SCIM-Client/blob/version_2.4.3/src/main/java/gluu/scim2/client/BaseScim2ClientImpl.java#L1016](https://github.com/GluuFederation/SCIM-Client/blob/version_2.4.3/src/main/java/gluu/scim2/client/BaseScim2ClientImpl.java#L1016) [https://github.com/GluuFederation/oxTrust/blob/version_2.4.3/server/src/main/java/org/gluu/oxtrust/ws/rs/scim2/UserWebService.java#L99](https://github.com/GluuFederation/oxTrust/blob/version_2.4.3/server/src/main/java/org/gluu/oxtrust/ws/rs/scim2/UserWebService.java#L99)