SCIM schema library

0.1 2017-11-25 22:18 UTC

This package is not auto-updated.

Last update: 2021-09-18 02:41:19 UTC


SCIM schema PHP library with support for both v1 and v2.

Note: This library is still work in progress, and you are welcome to help and contribute

It was made by the specs from SimpleCloud and by the example documents generated by PowerDMS/Owin.Scim

Do not miss SCIM Filter Parser !

Author Build Status Coverage Status Quality Score License Packagist Version


Build default schema

$schemaBuilder = new SchemaBuilderV2(); // or SchemaBuilderV1

$groupSchema = $schemaBuilder->getGroup();
$userSchema  = $schemaBuilder->getUser();
$enterpriseUserSchema = $schemaBuilder->getEnterpriseUser();
$schemaSchema = $schemaBuilder->getSchema();
$serviceProviderConfigSchema = $schemaBuilder->getServiceProviderConfig();
$resourceTypeSchema = $schemaBuilder->getResourceType();

Or build your own custom schema

$schema = new Schema();
    AttributeBuilder::create('name', ScimConstants::ATTRIBUTE_TYPE_STRING, 'Name of the object')

And serialize the scim schema object

$schema = (new SchemaBuilderV2())->getUser();

Schema validation

An object can be validated against a schema

/** @var array $object */
$object = getTheObjectAsArray();

$validator = new SchemaValidator();
$objectSchema = getTheSchema();
$schemaExtensions = getSchemaExtensions();

$validationResult = $validator->validate(

if (!$validationResult->getErrors()) {
    // cool!
} else {
    print implode("\n", $validationResult->getErrorsAsStrings());