Skip to content

SCIM 2.0

  • RFC 7642 – SCIM Definitions, Overview, Concepts
  • RFC 7643 – SCIM Core Schema
  • RFC 7644 – SCIM Protocol
  • RFC 6750, RFC 9068 – the bearer access tokens SCIM clients authenticate with
Flow ID Name Description
user-lifecycle User Lifecycle Create, read, update, deactivate users
group-membership Group Membership Group CRUD and membership management
user-discovery User Discovery Filter expressions and search queries
bulk-operations Bulk Operations Batch create/update/delete (documented; Looking Glass does not run this flow)
schema-discovery Schema Discovery ServiceProviderConfig, ResourceTypes, Schemas

Outbound provisioning exists as a documented SCIM client pattern (outbound-provisioning) and is not executable in Looking Glass: it needs an external SCIM server.

  • Basic User Provisioning – User CRUD lifecycle
  • Filter Expression Demo – SCIM filter query syntax
  • PATCH Operations Demo – Add, remove, replace operations
Path Methods Purpose
/scim/v2/ServiceProviderConfig GET Service provider capabilities
/scim/v2/ResourceTypes GET Available resource types
/scim/v2/ResourceTypes/{id} GET Resource type by ID
/scim/v2/Schemas GET Supported schemas
/scim/v2/Schemas/{id} GET Schema by ID
/scim/v2/Users GET, POST List/create users
/scim/v2/Users/{id} GET, PUT, PATCH, DELETE User operations
/scim/v2/Groups GET, POST List/create groups
/scim/v2/Groups/{id} GET, PUT, PATCH, DELETE Group operations
/scim/v2/Bulk POST Bulk operations
/scim/v2/.search, /scim/v2/Users/.search, /scim/v2/Groups/.search POST Query with the parameters in the body
/scim/v2 GET Query Users and Groups together
/scim/v2/Me any Not offered: answers 501 (RFC 7644 Section 3.11)

RFC 7644 Section 2 defines no SCIM-specific scheme: “SCIM depends on the use of Transport Layer Security (TLS) and/or standard HTTP authentication and authorization schemes”. This service provider is an OAuth 2.0 protected resource. Every flow starts by requesting an access token, which Looking Glass shows as its first step.

  1. GET /scim/v2/ServiceProviderConfig needs no token. Its authenticationSchemes names one scheme, oauthbearertoken.
  2. The client requests a token from POST /oauth2/token with grant_type=client_credentials as the seeded client scim-client (secret at GET /oauth2/demo/clients). Scope scim.read authorizes retrieval; scim.write authorizes creation, modification and deletion.
  3. The token is an RFC 9068 JWT access token. Its aud is the SCIM base URI {origin}/scim/v2 and its exp bounds its lifetime, which RFC 7644 Section 7.4 requires of every bearer token.
  4. The client sends Authorization: Bearer <access_token> on each SCIM request.

What the service provider returns when it refuses a request:

Request Status WWW-Authenticate
No Authorization header, or a scheme other than Bearer 401 Bearer realm="scim"
Token that is expired, revoked, from another issuer or for another resource 401 Bearer realm="scim", error="invalid_token", error_description="..."
Token without the scope the request needs 403 Bearer realm="scim", error="insufficient_scope", error_description="...", scope="scim.write"

The body is the RFC 7644 Section 3.12 error, with status as a JSON string. Deployment settings are on the SCIM service page.

These are the rules a provisioning client can rely on here, with the text they come from. The SCIM User example page shows a captured User with every attribute annotated.

  • id is the service provider’s. RFC 7643 Section 3.1: “The value of the “id” attribute is always issued by the service provider and MUST NOT be specified by the client.” An id, meta or groups in a POST or PUT body is ignored (RFC 7644 Sections 3.3 and 3.5.1).
  • meta.location matches the headers. A 201 carries the User’s URI in Location (RFC 7644 Section 3.3). Every response that returns one resource carries it in Content-Location, and meta.version in ETag (RFC 7643 Section 3.1).
  • userName is unique without regard to case. [email protected] and [email protected] are the same userName, compared with the PRECIS UsernameCaseMapped profile (RFC 7644 Section 5). A second one gets 409 with scimType uniqueness. A userName the profile does not allow, such as one with a space, gets 400 with invalidValue.
  • schemas is checked. It must be present, name the core schema of the resource type, name only schemas that type defines, and repeat nothing (RFC 7643 Section 3). Otherwise the response is 400.
  • Conditional retrieval works. GET with If-None-Match set to the current entity-tag returns 304 and no body (RFC 7644 Section 3.14).
  • Accept: application/json is honoured. The same JSON is labelled application/json for a client that asks for that and not for application/scim+json (RFC 7644 Section 3.8).
  • Email domains are lower-cased on input (RFC 7643 Section 4.1.2).
  • Passwords are not kept. The password attribute is dropped on input and never returned, so ServiceProviderConfig reports changePassword.supported as false.

A query runs against one resource type, or against the Base URI for Users and Groups together (RFC 7644 Section 3.4.2).

  • Filters follow the grammar of Section 3.4.2.2: eq, ne, co, sw, ew, pr, gt, ge, lt, le, joined with and, or and not, grouped with round brackets. A value filter in square brackets applies to one value of a multi-valued attribute: emails[type eq "work" and value co "@example.com"].
  • Comparison follows the attribute. userName eq "[email protected]" matches because userName is not case exact; id is. Dates compare chronologically. gt on a boolean gets 400 with scimType invalidFilter, and so does an operator the grammar does not have.
  • Attribute names may carry their schema URI, which extension attributes should: urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:department eq "Security".
  • Sorting takes sortBy and sortOrder. Resources with no value for the attribute come last when ascending and first when descending. A multi-valued attribute sorts by its primary value.
  • Paging takes startIndex and count. count=0 returns totalResults and no resources. A page holds at most 200.
  • attributes and excludedAttributes choose what is returned, on queries and on the responses of GET, POST, PUT and PATCH. id and schemas are always returned.
  • PATCH is atomic. If one operation fails, none is applied (RFC 7644 Section 3.5.2). A PATCH that changes nothing leaves meta.version and meta.lastModified as they were.
  • PATCH respects the schema. Changing a read-only attribute such as id, meta or a User’s groups, or removing a required one such as userName, gets 400 with scimType mutability. A value filter that matches nothing gets noTarget.
  • One primary value. Setting primary to true on one value of a multi-valued attribute sets it to false on the others.
  • If-Match is honoured on PUT, PATCH and DELETE: an entity-tag that is not the current meta.version gets 412 and nothing changes (RFC 7644 Section 3.14).
  • Group members are Users of this service provider. A member that is not one gets 400. A User’s groups attribute is read-only and follows the Groups.
  • Bulk performs each operation as the single request it stands for and reports each result. bulkId: references are resolved whatever the order of the operations. More than 1000 operations or 1 MiB gets 413.
  • Authentication: the WWW-Authenticate challenge on a 401, and the 403 a scim.read token gets on POST /scim/v2/Users

  • User schema: userName, name, emails, active, meta

  • Group membership: members array with $ref and display

  • PATCH semantics: add, remove, replace operations

  • Filter expressions: eq, co, sw, gt, lt operators

  • Bulk: operation count, error handling, atomicity

  • ETag: If-Match / If-None-Match for concurrent updates