dev-master
9999999-dev https://github.com/tmilos/scim-schemaSCIM schema library
MIT
The Requires
- php ^5.6|^7.0
The Development Requires
by Milos Tomic
scim rfc7643 scim schema
SCIM schema library
SCIM schema PHP library with support for both v1 and v2., (*1)
Note: This library is still work in progress, and you are welcome to help and contribute, (*2)
It was made by the specs from SimpleCloud and by the example documents generated by PowerDMS/Owin.Scim, (*3)
Do not miss SCIM Filter Parser !, (*4)
Install Scim Schema using composer:, (*6)
composer require tmilos/scim-schema
Build default schema:, (*7)
$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:, (*8)
$schema = new Schema(); $schema->setName('CustomSchema'); $schema->addAttribute( AttributeBuilder::create('name', ScimConstants::ATTRIBUTE_TYPE_STRING, 'Name of the object') ->setMutability(false) ->getAttribute() );
And serialize the scim schema object, (*9)
$schema = (new SchemaBuilderV2())->getUser(); $schema->serializeObject();
An object can be validated against a schema:, (*10)
/** @var array $object */ $object = getTheObjectAsArray(); $validator = new SchemaValidator(); $objectSchema = getTheSchema(); $schemaExtensions = getSchemaExtensions(); $validationResult = $validator->validate( $object, $objectSchema, $schemaExtensions ); if (!$validationResult->getErrors()) { // cool! } else { print implode("\n", $validationResult->getErrorsAsStrings()); }
SCIM schema library
MIT
scim rfc7643 scim schema