Introduction
The SCIM Client is used to make requests to SCIM Service Providers. The Rock Solid Knowledge SCIM component allows you to register custom resources that a SCIM client can make requests with as well as register service providers to send these requests to.
SCIM Client Purpose
The SCIM Client makes requests to SCIM service providers using models that you define (i.e., models the SCIM Client is aware of). You also provide a mapper to go from the custom model to either the preexisting SCIM types (User, Group, and EnterpriseUser) or types that the SCIM Service Provider has defined that you are aware of (i.e., you can map to).
Capabilities
By registering the model (covered in the installation section) and the service provider and then injecting the IScimClient
, you can perform CRUD operations against either all service providers you have registered or to specific service providers. The providers
parameter is a collection of the names of the service providers you wish to call.
public interface IScimClient<TCustomResource, TScimResourceResource>
where TCustomResource : class
where TScimResourceResource : Resource
{
Task<IAggregateScimResult<TScimResourceResource>> Create(TCustomResource resource, CancellationToken cancellationToken);
Task<IAggregateScimResult<TScimResourceResource>> Create(TCustomResource resource, IEnumerable<string> providers, CancellationToken cancellationToken);
Task<IAggregateScimResult<TScimResourceResource>> Update(TCustomResource resource, IEnumerable<ServiceProviderResource> providers, CancellationToken cancellationToken);
Task<IScimClientResult<TScimResourceResource>> Read(ServiceProviderResource resource, CancellationToken cancellationToken);
Task<IScimClientResult> Delete(ServiceProviderResource resource, CancellationToken cancellationToken);
}
The type returned from the Read and Delete methods is IScimClientResult
. This interface contains information about the request, including the service provider name that the request was run against, the status code, and any errors that the request returned. The Create and Update requests return the IScimAggregateResult
interface. This interface includes a collection of IScimClientResult
so you can see the results from the service providers that were called. There is also a property named IsSuccess
, which returns true if all IsSuccess
properties are true on the contained InnerResults
.
public interface IScimClientResult
{
bool IsSuccess { get; }
ScimStatusCode StatusCode { get; }
string ErrorMessage { get; }
string ResourceId { get; }
string ServiceProviderName { get; }
string ServiceProviderUrl { get; }
}
public interface IAggregateScimResult<TResource>
where TResource : Resource
{
bool IsSuccess { get; }
IEnumerable<IScimClientResult<TResource>> InnerResults { get; }
}