scim2 icon indicating copy to clipboard operation
scim2 copied to clipboard

GetGroup throws com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException while fetching group.

Open ghost opened this issue 5 years ago • 4 comments

Describe the bug When we are trying to fetch Group who has some members associated with it. It throws exception.

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "type" (class com.unboundid.scim2.common.types.Member), not marked as ignorable (3 known properties: "value", "display", "$ref"]) at [Source: (org.glassfish.jersey.message.internal.EntityInputStream); line: 1, column: 311] (through reference chain: com.unboundid.scim2.common.types.GroupResource["members"]->java.util.ArrayList[0]->com.unboundid.scim2.common.types.Member["type"]) at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:61) ~[jackson-databind-2.10.4.jar:2.10.4] at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:843) ~[jackson-databind-2.10.4.jar:2.10.4] at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1206) ~[jackson-databind-2.10.4.jar:2.10.4]

To Reproduce

  1. Create group.
  2. add Rmember to Group.
  3. getch the same Group again Expected behavior It should give Group details.

Additional context Add any other context about the problem here. For example:

  • Java version: [e.g. Java 8]
  • SCIM 2 SDK version: [e.g. 2.3.4 release]

ghost avatar Jun 20 '20 03:06 ghost

Hi,

It seems your server is returning a 'type' field in it's response. The SCIM 2 SDK doesn't know anything about a 'type' field for the Member in the GroupResouce object. Adding a member seems to not require this 'type' field. But when you fetch the Group you get something back.

Here are a few questions that might help to solve this: What server / service are you working with? Who is the vendor? (Every vendor / product seems to interpret the standard a bit differently) What does the 'Schema' of your server product say about the attributes of the 'Group' -> 'Member' object? (Maybe you need to develop your own 'Group' resource class and include the 'type' attribute in your own implementation).

When I wrote a client application I checked the 'Schema' of the target server and that 'Schema' claimed to (additionally) provide a 'type' field for the 'Member' object. And there were a bunch of other issues with the provided 'Schema', which I had to workaround.

lachee10 avatar Jun 20 '20 13:06 lachee10

Hi, If I develop my onw Group. Could you please let me know How i can use my Own created Group to ScimService for all group related operation? Thanks, Sagar

ersagarnikam avatar Jun 28 '20 05:06 ersagarnikam

I'm not sure how your client code looks like. Therefore any advise is a bit hard.

My guess is you need to replace the usage of the 'GroupResource' with your own developed 'Group'.

Have a look at https://github.com/pingidentity/scim2/wiki/Working-with-SCIM-resources#converting-between-basescimresources-and-genericscimresources

lachee10 avatar Jun 29 '20 11:06 lachee10

We are running into this problem when talking to Litmos. There is a type field in the list of group members that causes Jackson to error out.

We have gotten around it by applying the code snippet in #81 in a wrapper we have around this library.

ToeBee avatar Nov 17 '21 22:11 ToeBee