objectClass("User") {
scim {
extension("enterprise", "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User")
}
attribute("givenName") {
scim {
path attribute("name").child("givenName")
}
}
}
SCIM Schema customization
While the framework provides automatic schema discovery, you often need to customize it for your specific use case.
This document is part of the SCIM 2.0 connector tutorial. See Introduction to SCIMREST framework for other topics.
Schema customization blocks
Schema customization is defined in Groovy scripts using the objectClass() and attribute() builders with SCIM-specific blocks.
SCIM extensions
Define SCIM schema extensions using the scim { extension(…) } block:
objectClass("User") {
scim {
extension("enterprise", "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User")
}
}
Extensions allow you to reference attributes from SCIM schema extensions.
Path-based attribute mapping
SCIM uses nested attribute paths (e.g., name.givenName). Map these to flat ConnId attributes:
objectClass("User") {
attribute("givenName") {
scim {
path attribute("name").child("givenName")
}
}
attribute("familyName") {
scim {
path attribute("name").child("familyName")
}
}
attribute("employeeNumber") {
scim {
path extension("enterprise").child("employeeNumber")
}
}
}
The path method specifies the SCIM attribute path. Use attribute() for regular attributes and extension() for extension attributes.
Value filter for multi-valued attributes
For multi-valued attributes with primary/primary flags, use value filters:
attribute("primaryEmail") {
scim {
path attribute("emails").valueFilter("primary", true).child("value")
}
}
This maps the value field from the email object where primary is true.
ConnId attribute mapping
Map SCIM attributes to ConnId built-in attributes:
objectClass("User") {
connIdAttribute("UID", "id")
connIdAttribute("NAME", "userName")
}
The ConnId framework requires UID and NAME attributes. Map them to the appropriate SCIM attributes.
SCIM-specific schema blocks
The scim block supports:
Block |
Description |
Example |
|
Define SCIM schema extension |
|
|
Specify SCIM attribute path |
|
|
Override SCIM attribute name |
|
|
Only include explicitly listed attributes |
|
Complete example
objectClass("User") {
scim {
extension("enterprise", "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User")
}
connIdAttribute("UID", "id")
connIdAttribute("NAME", "userName")
attribute("givenName") {
scim {
path attribute("name").child("givenName")
}
}
attribute("familyName") {
scim {
path attribute("name").child("familyName")
}
}
attribute("employeeNumber") {
scim {
path extension("enterprise").child("employeeNumber")
}
}
attribute("primaryEmail") {
scim {
path attribute("emails").valueFilter("primary", true).child("value")
}
}
}