2

I am trying to extend the user model and add a new string property. If I understand, I can simply add it and return the value.

My question is how do I document this in the resource type endpoint. Currently we have just the basic scim implementation so we return

"Resources": [
{
    "name": "User",
    "description": "User Accounts",
    "endpoint": "/Users",
    "schema": "urn:ietf:params:scim:schemas:core:2.0:User",
    "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:ResourceType"
    ],
    "id": "User",
   "meta": {
        "resourceType": "ResourceType",
        "location": "https://apidsw017086.docusignhq.com/v201411/scim/resourcetypes/user"
   }
}

Should I just add the attribute section and add the new attribute, or do I need to list all the default attributes as well?

Eugene
  • 73
  • 5

1 Answers1

2

As described in RFC 7643 Section 3.3, you need to define a new schema and specify that schema in the ResourceType "schemaExtensions". You can look at the enterprise user schema extension throughout the spec for an example of how to do this.

Example Resource Type Representation:

[
    {
         "schemas": ["urn:ietf:params:scim:schemas:core:2.0:ResourceType"],
         "id": "User",
         "name": "User",
         "endpoint": "/Users",
         "description": "User Account",
         "schema": "urn:ietf:params:scim:schemas:core:2.0:User",
         "schemaExtensions": [
           {
             "schema": "urn:your:user:extension:schema",
             "required": false
           }
         ],
         "meta": {
           "location": "https://example.com/v2/ResourceTypes/User",
           "resourceType": "ResourceType"
         }
    }
]

Example Resource Schema Representation:

[
    {
        "id": "urn:ietf:params:scim:schemas:core:2.0:User",
        "schemas": [ "urn:ietf:params:scim:schemas:core:2.0:Schema" ],
        "name": "User",
        "description": "User Account",
        "attributes": [ {...} ]
    },
    {
        "id": "urn:your:user:extension:schema",
        "schemas": [ "urn:ietf:params:scim:schemas:core:2.0:Schema" ],
        "name": "Your Custom User Extension Name",
        "description": "Your Custom User Extension Description",
        "attributes": [ {...} ]
    }
]
Community
  • 1
  • 1
shelley
  • 7,206
  • 4
  • 36
  • 63