<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Arie Timmerman's blog]]></title><description><![CDATA[Arie Timmerman's blog]]></description><link>https://identityandaccess.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Tue, 01 Sep 2026 00:47:41 GMT</lastBuildDate><atom:link href="https://identityandaccess.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Unlock the power of SCIM in just 5 minutes]]></title><description><![CDATA[SCIM, or System for Cross-domain Identity Management, is a standard protocol for managing identities via APIs. It is widely adopted by many well-known IT solutions from vendors such as Microsoft (Entra ID), AWS, Oracle, Salesforce, and many others.
T...]]></description><link>https://identityandaccess.hashnode.dev/unlock-the-power-of-scim-in-just-5-minutes</link><guid isPermaLink="true">https://identityandaccess.hashnode.dev/unlock-the-power-of-scim-in-just-5-minutes</guid><category><![CDATA[SCIM]]></category><category><![CDATA[identity-management]]></category><category><![CDATA[APIs]]></category><category><![CDATA[Security]]></category><dc:creator><![CDATA[Arie Timmerman]]></dc:creator><pubDate>Thu, 11 Jan 2024 11:33:53 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1704973398964/dcc49523-e20e-41fa-9322-be40daad7438.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>SCIM, or System for Cross-domain Identity Management, is a standard protocol for managing identities via APIs. It is widely adopted by many well-known IT solutions from vendors such as Microsoft (Entra ID), AWS, Oracle, Salesforce, and many others.</p>
<p>The most commonly used functionalities of SCIM include listing, creating, and updating users. Additionally, it is often utilized to assign users to groups, effectively managing permissions.</p>
<p>A valuable resource for learning SCIM is the SCIM playground available at <a target="_blank" href="https://scim.dev">scim.dev</a>. This web application is an excellent tool if you’re interested in testing SCIM calls or integrating your application with a SCIM sandbox server.</p>
<h2 id="heading-list-users">List Users</h2>
<p>A GET request to the <code>/Users</code> endpoint retrieves all users. It’s important to note that pagination is typically implemented in such responses. You can navigate through the results using the <code>startIndex</code> parameter. An example response is provided below for your reference. Please note that the list of users is encapsulated within the <code>Resources</code> attribute. While the SCIM protocol defines <code>User</code> and <code>Group</code> as Resources, it also provides the flexibility for you to introduce custom resources as needed.</p>
<pre><code class="lang-json">{
  <span class="hljs-attr">"totalResults"</span>: <span class="hljs-number">1</span>,
  <span class="hljs-attr">"itemsPerPage"</span>: <span class="hljs-number">1</span>,
  <span class="hljs-attr">"startIndex"</span>: <span class="hljs-number">1</span>,
  <span class="hljs-attr">"schemas"</span>: [
    <span class="hljs-string">"urn:ietf:params:scim:api:messages:2.0:ListResponse"</span>
  ],
  <span class="hljs-attr">"Resources"</span>: [
    {
      <span class="hljs-attr">"id"</span>: <span class="hljs-string">"9b10f477-10c2-4d38-a509-e64b98857d2f"</span>,
      <span class="hljs-attr">"meta"</span>: {
        <span class="hljs-attr">"created"</span>: <span class="hljs-string">"2024-01-11T11:07:12+00:00"</span>,
        <span class="hljs-attr">"lastModified"</span>: <span class="hljs-string">"2024-01-11T11:07:12+00:00"</span>,
        <span class="hljs-attr">"location"</span>: <span class="hljs-string">"https://api.scim.dev/scim/v2/Users/9b10f477-10c2-4d38-a509-e64b98857d2f"</span>,
        <span class="hljs-attr">"resourceType"</span>: <span class="hljs-string">"User"</span>
      },
      <span class="hljs-attr">"urn:ietf:params:scim:schemas:core:2.0:User"</span>: {
        <span class="hljs-attr">"userName"</span>: <span class="hljs-string">"bjensen"</span>,
        <span class="hljs-attr">"name"</span>: {
          <span class="hljs-attr">"formatted"</span>: <span class="hljs-string">"Ms. Barbara J Jensen III"</span>,
          <span class="hljs-attr">"familyName"</span>: <span class="hljs-string">"Jensen"</span>,
          <span class="hljs-attr">"givenName"</span>: <span class="hljs-string">"Barbara"</span>
        },
        <span class="hljs-attr">"active"</span>: <span class="hljs-literal">true</span>,
        <span class="hljs-attr">"emails"</span>: [
          {
            <span class="hljs-attr">"value"</span>: <span class="hljs-string">"barbara.jensen@example.com"</span>,
            <span class="hljs-attr">"type"</span>: <span class="hljs-string">"other"</span>,
            <span class="hljs-attr">"primary"</span>: <span class="hljs-literal">true</span>
          },
          {
            <span class="hljs-attr">"value"</span>: <span class="hljs-string">"barbara.jensen@example.com"</span>,
            <span class="hljs-attr">"type"</span>: <span class="hljs-string">"work"</span>,
            <span class="hljs-attr">"primary"</span>: <span class="hljs-literal">true</span>
          }
        ]
      },
      <span class="hljs-attr">"schemas"</span>: [
        <span class="hljs-string">"urn:ietf:params:scim:schemas:core:2.0:User"</span>,
        <span class="hljs-string">"example:name:space"</span>
      ]
    }
  ]
}
</code></pre>
<h2 id="heading-create-user">Create User</h2>
<p>Users can be created by issuing a POST request to the <code>/Users</code> endpoint. It’s crucial to include all required attributes in the body of the request.</p>
<pre><code class="lang-json">{
  <span class="hljs-attr">"schemas"</span>: [
    <span class="hljs-string">"urn:ietf:params:scim:schemas:core:2.0:User"</span>
  ],
  <span class="hljs-attr">"externalId"</span>: <span class="hljs-string">"bjensen"</span>,
  <span class="hljs-attr">"name"</span>: {
    <span class="hljs-attr">"formatted"</span>: <span class="hljs-string">"Ms. Barbara J Jensen III"</span>,
    <span class="hljs-attr">"familyName"</span>: <span class="hljs-string">"Jensen"</span>,
    <span class="hljs-attr">"givenName"</span>: <span class="hljs-string">"Barbara"</span>
  },
  <span class="hljs-attr">"active"</span>: <span class="hljs-literal">true</span>,
  <span class="hljs-attr">"emails"</span>: [
    {
      <span class="hljs-attr">"value"</span>: <span class="hljs-string">"barbara.jensen@example.com"</span>
    }
  ],
  <span class="hljs-attr">"userName"</span>: <span class="hljs-string">"bjensen"</span>
}
</code></pre>
<p>This request should yield a <code>201 Created</code> HTTP response. The body of the response will contain the newly created user with the specified attributes, in addition to attributes generated by the SCIM server, such as timestamps for creation and modification, as well as a unique identifier.</p>
<h2 id="heading-update-users">Update Users</h2>
<p>In SCIM, a user can be updated using either a PATCH or PUT request. The former allows for the modification of a specific attribute, while the latter replaces the entire User object. Although this might seem less than ideal, a PUT request is typically easier to implement.</p>
<p>For a PUT request, the identifier of the User must be specified in the URI, such as <code>/Users/9b10f477-10c2-4d38-a509-e64b98857d2f</code>. This identifier is returned upon the creation of the user, or it can be retrieved by first listing the users.</p>
<p>The body of the request should contain the complete user object. An example is provided below.</p>
<pre><code class="lang-json">{
  <span class="hljs-attr">"schemas"</span>: [
    <span class="hljs-string">"urn:ietf:params:scim:schemas:core:2.0:User"</span>
  ],
  <span class="hljs-attr">"externalId"</span>: <span class="hljs-string">"jcleese"</span>,
  <span class="hljs-attr">"name"</span>: {
    <span class="hljs-attr">"formatted"</span>: <span class="hljs-string">"Mr. John Cleese"</span>,
    <span class="hljs-attr">"familyName"</span>: <span class="hljs-string">"Cleese"</span>,
    <span class="hljs-attr">"givenName"</span>: <span class="hljs-string">"John"</span>
  },
  <span class="hljs-attr">"emails"</span>: [
    {
      <span class="hljs-attr">"value"</span>: <span class="hljs-string">"john.cleese@example.com"</span>
    }
  ],
  <span class="hljs-attr">"userName"</span>: <span class="hljs-string">"jcleese"</span>
}
</code></pre>
<h2 id="heading-assign-groups-to-users">Assign Groups to Users</h2>
<p>Often, an application needs to assign groups, or permissions, to users. This is typically accomplished by issuing a PATCH request to a specific Group endpoint, such as <code>/Groups/9b10f964-ef91-4e41-97dd-85bb6d28b158</code>. The body of this request should include the identifier of the user who is to be added as a member.</p>
<pre><code class="lang-json">{
  <span class="hljs-attr">"schemas"</span>: [
    <span class="hljs-string">"urn:ietf:params:scim:api:messages:2.0:PatchOp"</span>
  ],
  <span class="hljs-attr">"Operations"</span>: [
    {
      <span class="hljs-attr">"op"</span>: <span class="hljs-string">"add"</span>,
      <span class="hljs-attr">"path"</span>: <span class="hljs-string">"members"</span>,
      <span class="hljs-attr">"value"</span>: [
        {
          <span class="hljs-attr">"value"</span>: <span class="hljs-string">"9b10f477-10c2-4d38-a509-e64b98857d2f"</span>
        }
      ]
    }
  ]
}
</code></pre>
<h2 id="heading-want-to-learn-more">Want to learn more?</h2>
<p>SCIM offers more than just the basic features mentioned. For instance, it provides an advanced filtering method for retrieving specific resources such as users. It also includes metadata that offers information about the attributes associated with resources, supports bulk requests, and allows for advanced patch requests.</p>
<p>Interested in exploring further? Experiment with the wide range of functionalities offered by the SCIM protocol at <a target="_blank" href="https://scim.dev">scim.dev</a>.</p>
]]></content:encoded></item></channel></rss>