scim2 icon indicating copy to clipboard operation
scim2 copied to clipboard

Unassigned multi-valued attributes are set to null instead of empty array when UserResource is used.

Open fmemis opened this issue 3 years ago • 0 comments

According to https://tools.ietf.org/html/rfc7644#section-3.3 multi valued attributes should be set to [] in case clients intend to override server-defaulted values.

However when public <T extends com.unboundid.scim2.common.ScimResource> T create(String endpoint,T resource) is called with resource of type UserResource, ALL unassigned values are set to null. This is ok for single valued attributes but problematic for multi-valued ones and may result to com.unboundid.scim2.common.exceptions.BadRequestException.

{"schemas" : [ "urn:ietf:params:scim:api:messages:2.0:Error" ], "status" : "400", "scimType" : "invalidSyntax", "detail" : "Request is unparsable, syntactically incorrect, or violates schema."}

Example of request body that is being sent to the service provider: { "schemas": [ "urn:ietf:params:scim:schemas:core:2.0:User" ], "id": null, "externalId": null, "meta": null, "userName": "jsmith", "name": { "formatted": null, "familyName": null, "givenName": null, "middleName": null, "honorificPrefix": null, "honorificSuffix": null }, "displayName": null, "nickName": null, "profileUrl": null, "title": null, "userType": null, "preferredLanguage": null, "locale": null, "timezone": null, "active": true, "password": "secret", "emails": [ { "value": "[email protected]", "display": null, "type": null, "primary": true }, { "value": "[email protected]", "display": null, "type": null, "primary": null } ], "phoneNumbers": [ { "value": "+449878979789", "display": null, "type": null, "primary": true } ], "ims": null, "photos": null, "addresses": null, "groups": null, "entitlements": null, "roles": null, "x509Certificates": null }

As mentioned before, the multi-valued attributes of the above request are expected to be set to []. For example:

{ "schemas": [ "urn:ietf:params:scim:schemas:core:2.0:User" ], "id": null, "externalId": null, "meta": null, "userName": "jsmith", ... ... "phoneNumbers": [ { "value": "+449878979789", "display": null, "type": null, "primary": true } ], "ims": [], "photos": [], "addresses": [], "groups": [], "entitlements": [], "roles": [], "x509Certificates": [] }

fmemis avatar Mar 29 '21 11:03 fmemis