scim-server 0.4.0

A comprehensive SCIM 2.0 server library for Rust with multi-tenant support and type-safe operations
Documentation
<!DOCTYPE HTML>
<html lang="en" class="light sidebar-visible" dir="ltr">
    <head>
        <!-- Book generated using mdBook -->
        <meta charset="UTF-8">
        <title>Introduction - SCIM Server Guide</title>


        <!-- Custom HTML head -->

        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="theme-color" content="#ffffff">

        <link rel="icon" href="favicon.svg">
        <link rel="shortcut icon" href="favicon.png">
        <link rel="stylesheet" href="css/variables.css">
        <link rel="stylesheet" href="css/general.css">
        <link rel="stylesheet" href="css/chrome.css">
        <link rel="stylesheet" href="css/print.css" media="print">

        <!-- Fonts -->
        <link rel="stylesheet" href="FontAwesome/css/font-awesome.css">
        <link rel="stylesheet" href="fonts/fonts.css">

        <!-- Highlight.js Stylesheets -->
        <link rel="stylesheet" id="highlight-css" href="highlight.css">
        <link rel="stylesheet" id="tomorrow-night-css" href="tomorrow-night.css">
        <link rel="stylesheet" id="ayu-highlight-css" href="ayu-highlight.css">

        <!-- Custom theme stylesheets -->


        <!-- Provide site root and default themes to javascript -->
        <script>
            const path_to_root = "";
            const default_light_theme = "light";
            const default_dark_theme = "navy";
            window.path_to_searchindex_js = "searchindex.js";
        </script>
        <!-- Start loading toc.js asap -->
        <script src="toc.js"></script>
    </head>
    <body>
    <div id="mdbook-help-container">
        <div id="mdbook-help-popup">
            <h2 class="mdbook-help-title">Keyboard shortcuts</h2>
            <div>
                <p>Press <kbd>←</kbd> or <kbd>→</kbd> to navigate between chapters</p>
                <p>Press <kbd>S</kbd> or <kbd>/</kbd> to search in the book</p>
                <p>Press <kbd>?</kbd> to show this help</p>
                <p>Press <kbd>Esc</kbd> to hide this help</p>
            </div>
        </div>
    </div>
    <div id="body-container">
        <!-- Work around some values being stored in localStorage wrapped in quotes -->
        <script>
            try {
                let theme = localStorage.getItem('mdbook-theme');
                let sidebar = localStorage.getItem('mdbook-sidebar');

                if (theme.startsWith('"') && theme.endsWith('"')) {
                    localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
                }

                if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
                    localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
                }
            } catch (e) { }
        </script>

        <!-- Set the theme before any content is loaded, prevents flash -->
        <script>
            const default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? default_dark_theme : default_light_theme;
            let theme;
            try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
            if (theme === null || theme === undefined) { theme = default_theme; }
            const html = document.documentElement;
            html.classList.remove('light')
            html.classList.add(theme);
            html.classList.add("js");
        </script>

        <input type="checkbox" id="sidebar-toggle-anchor" class="hidden">

        <!-- Hide / unhide sidebar before it is displayed -->
        <script>
            let sidebar = null;
            const sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
            if (document.body.clientWidth >= 1080) {
                try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
                sidebar = sidebar || 'visible';
            } else {
                sidebar = 'hidden';
                sidebar_toggle.checked = false;
            }
            if (sidebar === 'visible') {
                sidebar_toggle.checked = true;
            } else {
                html.classList.remove('sidebar-visible');
            }
        </script>

        <nav id="sidebar" class="sidebar" aria-label="Table of contents">
            <!-- populated by js -->
            <mdbook-sidebar-scrollbox class="sidebar-scrollbox"></mdbook-sidebar-scrollbox>
            <noscript>
                <iframe class="sidebar-iframe-outer" src="toc.html"></iframe>
            </noscript>
            <div id="sidebar-resize-handle" class="sidebar-resize-handle">
                <div class="sidebar-resize-indicator"></div>
            </div>
        </nav>

        <div id="page-wrapper" class="page-wrapper">

            <div class="page">
                <div id="menu-bar-hover-placeholder"></div>
                <div id="menu-bar" class="menu-bar sticky">
                    <div class="left-buttons">
                        <label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
                            <i class="fa fa-bars"></i>
                        </label>
                        <button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
                            <i class="fa fa-paint-brush"></i>
                        </button>
                        <ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
                            <li role="none"><button role="menuitem" class="theme" id="default_theme">Auto</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="light">Light</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
                        </ul>
                        <button id="search-toggle" class="icon-button" type="button" title="Search (`/`)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="/ s" aria-controls="searchbar">
                            <i class="fa fa-search"></i>
                        </button>
                    </div>

                    <h1 class="menu-title">SCIM Server Guide</h1>

                    <div class="right-buttons">
                        <a href="print.html" title="Print this book" aria-label="Print this book">
                            <i id="print-button" class="fa fa-print"></i>
                        </a>

                    </div>
                </div>

                <div id="search-wrapper" class="hidden">
                    <form id="searchbar-outer" class="searchbar-outer">
                        <div class="search-wrapper">
                            <input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
                            <div class="spinner-wrapper">
                                <i class="fa fa-spinner fa-spin"></i>
                            </div>
                        </div>
                    </form>
                    <div id="searchresults-outer" class="searchresults-outer hidden">
                        <div id="searchresults-header" class="searchresults-header"></div>
                        <ul id="searchresults">
                        </ul>
                    </div>
                </div>

                <!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
                <script>
                    document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
                    document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
                    Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
                        link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
                    });
                </script>

                <div id="content" class="content">
                    <main>
                        <h1 id="scim-server-guide"><a class="header" href="#scim-server-guide">SCIM Server Guide</a></h1>
<p>Welcome to the comprehensive guide for the SCIM Server library! This guide will help you understand and use the Rust components for building enterprise-ready identity provisioning systems.</p>
<h2 id="the-problem"><a class="header" href="#the-problem">The Problem</a></h2>
<p>Your application needs to support enterprise customers, but they require SCIM provisioning—the ability to automatically create, update, and delete user accounts from their identity systems (Okta, Azure Entra, Google Workspace, etc.).</p>
<p>Research shows that <strong>authentication requirements become critical blockers in 75-80% of enterprise deals</strong>, with companies losing an average of <strong>3-5 enterprise deals annually</strong> due to insufficient identity capabilities. Building SCIM compliance seems straightforward at first: it's just REST APIs with JSON. But enterprise identity management has many hidden complexities that create months of unexpected work:</p>
<ul>
<li><strong>Provider Fragmentation</strong>: Identity providers interpret SCIM differently—email handling, user deactivation, and custom attributes work differently across Okta, Azure, and Google</li>
<li><strong>Protocol Compliance</strong>: SCIM 2.0 has strict requirements with <strong>10 common implementation pitfalls</strong> that cause enterprise integration failures</li>
<li><strong>Hidden Development Costs</strong>: Industry data shows <strong>3-6 months and $3.5M+</strong> in development costs for homegrown SSO/SCIM solutions over 3 years</li>
<li><strong>Ongoing Maintenance</strong>: Security incidents, provider-specific bugs, and manual customer onboarding create continuous overhead</li>
<li><strong>Schema Complexity</strong>: Extensible schemas with custom attributes while maintaining interoperability across different enterprise environments</li>
</ul>
<p>Many developers underestimate this complexity and spend months debugging provider-specific edge cases, dealing with "more deviation than standard" implementations, and handling enterprise customers who discover integration issues in production.</p>
<h2 id="what-is-scim-server"><a class="header" href="#what-is-scim-server">What is SCIM Server?</a></h2>
<p>SCIM Server is a Rust library that provides all the essential components for building SCIM 2.0-compliant systems. Instead of implementing SCIM from scratch, you get proven building blocks that handle the complex parts while letting you focus on your application logic.</p>
<p>The library uses the SCIM 2.0 protocol as a framework to standardize identity data validation and processing. You compose the components you need—from simple single-tenant systems to complex multi-tenant platforms with custom schemas and AI integration.</p>
<h2 id="what-you-get"><a class="header" href="#what-you-get">What You Get</a></h2>
<h3 id="ready-to-use-components"><a class="header" href="#ready-to-use-components">Ready-to-Use Components</a></h3>
<ul>
<li><strong><code>StandardResourceProvider</code></strong>: Complete SCIM resource operations for typical use cases</li>
<li><strong><code>InMemoryStorage</code></strong>: Development and testing storage backend</li>
<li><strong>Schema Registry</strong>: Pre-loaded with RFC 7643 User and Group schemas</li>
<li><strong>ETag Versioning</strong>: Automatic concurrency control for production deployments</li>
</ul>
<h3 id="extension-points"><a class="header" href="#extension-points">Extension Points</a></h3>
<ul>
<li><strong><code>ResourceProvider</code> trait</strong>: Implement for custom business logic and data models</li>
<li><strong><code>StorageProvider</code> trait</strong>: Connect to any database or storage system</li>
<li><strong>Custom Value Objects</strong>: Type-safe handling of domain-specific attributes</li>
<li><strong>Multi-Tenant Context</strong>: Built-in tenant isolation and context management</li>
</ul>
<h3 id="enterprise-features"><a class="header" href="#enterprise-features">Enterprise Features</a></h3>
<ul>
<li><strong>Protocol Compliance</strong>: All the RFC 7643/7644 complexity handled correctly</li>
<li><strong>Schema Extensions</strong>: Add custom attributes while maintaining SCIM compatibility</li>
<li><strong>AI Integration</strong>: Model Context Protocol support for AI agent interactions</li>
<li><strong>Production Ready</strong>: Structured logging, error handling, and performance optimizations</li>
</ul>
<h2 id="time--cost-savings"><a class="header" href="#time--cost-savings">Time &amp; Cost Savings</a></h2>
<p>Instead of facing the typical <strong>3-6 month development timeline and $3.5M+ costs</strong> that industry data shows for homegrown solutions, focus on your application:</p>
<div class="table-wrapper"><table><thead><tr><th><strong>Building From Scratch</strong></th><th><strong>Using SCIM Server</strong></th></tr></thead><tbody>
<tr><td>❌ 3-6 months learning SCIM protocol complexities</td><td>✅ Start building immediately with working components</td></tr>
<tr><td>❌ $3.5M+ development and maintenance costs over 3 years</td><td>✅ Fraction of the cost with proven components</td></tr>
<tr><td>❌ Debugging provider-specific implementation differences</td><td>✅ Handle Okta, Azure, Google variations automatically</td></tr>
<tr><td>❌ Building multi-tenant isolation from scratch</td><td>✅ Multi-tenant context and isolation built-in</td></tr>
<tr><td>❌ Lost enterprise deals due to auth requirements</td><td>✅ Enterprise-ready identity provisioning components</td></tr>
</tbody></table>
</div>
<p><strong>Result</strong>: Avoid the <strong>75-80% of enterprise deals that stall on authentication</strong> by having production-ready SCIM components instead of months of custom development.</p>
<h2 id="who-should-use-this"><a class="header" href="#who-should-use-this">Who Should Use This?</a></h2>
<p>This library is designed for Rust developers who need to:</p>
<ul>
<li><strong>Add enterprise customer support</strong> to SaaS applications requiring SCIM provisioning</li>
<li><strong>Build identity management tools</strong> that integrate with multiple identity providers</li>
<li><strong>Create AI agents</strong> that need to manage user accounts and permissions</li>
<li><strong>Develop custom identity solutions</strong> with specific business requirements</li>
<li><strong>Integrate existing systems</strong> with enterprise identity infrastructure</li>
</ul>
<h2 id="how-to-use-this-guide"><a class="header" href="#how-to-use-this-guide">How to Use This Guide</a></h2>
<p>The guide is organized into progressive sections:</p>
<ol>
<li><strong>Getting Started</strong>: Quick setup and basic usage</li>
<li><strong>Core Concepts</strong>: Understanding the fundamental ideas</li>
<li><strong>Tutorials</strong>: Step-by-step guides for common scenarios</li>
<li><strong>How-To Guides</strong>: Solutions for specific problems</li>
<li><strong>Advanced Topics</strong>: Deep dives into complex scenarios</li>
<li><strong>Reference</strong>: Technical specifications and details</li>
</ol>
<h3 id="learning-path"><a class="header" href="#learning-path">Learning Path</a></h3>
<p><strong>New to SCIM?</strong> Start with the <a href="./architecture.html">Architecture Overview</a> to understand the standard.</p>
<p><strong>Ready to code?</strong> Jump to <a href="./getting-started/first-server.html">Your First SCIM Server</a> for hands-on experience.</p>
<p><strong>Building production systems?</strong> Read through <a href="./getting-started/installation.html">Installation</a> and the examples in the GitHub repository.</p>
<h2 id="what-youll-learn"><a class="header" href="#what-youll-learn">What You'll Learn</a></h2>
<p>By the end of this guide, you'll understand how to:</p>
<ul>
<li>Compose SCIM Server components for your specific requirements</li>
<li>Implement the ResourceProvider trait for your application's data model</li>
<li>Create custom schema extensions and value objects</li>
<li>Build multi-tenant systems using the provided context components</li>
<li>Integrate SCIM components with web frameworks and AI tools</li>
<li>Deploy production systems using the concurrency and observability components</li>
</ul>
<h2 id="getting-help"><a class="header" href="#getting-help">Getting Help</a></h2>
<ul>
<li><strong>Examples</strong>: Check the <a href="https://github.com/pukeko37/scim-server/tree/main/examples">examples directory</a> for working code</li>
<li><strong>API Documentation</strong>: See <a href="https://docs.rs/scim-server">docs.rs</a> for detailed API reference</li>
<li><strong>Issues</strong>: Report bugs or ask questions on <a href="https://github.com/pukeko37/scim-server/issues">GitHub Issues</a></li>
</ul>
<p>Let's get started! 🚀</p>
<hr />
<h3 id="references"><a class="header" href="#references">References</a></h3>
<p><em>Enterprise authentication challenges and statistics sourced from:</em> <a href="https://guptadeepak.com/the-enterprise-ready-dilemma-navigating-authentication-challenges-in-b2b-saas/">Gupta, "Enterprise Authentication: The Hidden SaaS Growth Blocker"</a>, 2024; <a href="https://workos.com/blog/build-vs-buy-part-i-complexities-of-building-sso-and-scim-in-house">WorkOS "Build vs Buy" analysis</a>, 2024; <a href="https://workos.com/blog/build-vs-buy-part-ii-roi-comparison-between-homegrown-and-pre-built-solutions">WorkOS ROI comparison</a>, 2024.</p>
<p><em>SCIM implementation pitfalls from:</em> <a href="https://www.traxion.com/blog/the-10-most-common-pitfalls-for-scim-2-0-compliant-api-implementations">Traxion "10 Most Common Pitfalls for SCIM 2.0 Compliant API Implementations"</a> based on testing 40-50 SCIM implementations.</p>
<p><em>Provider-specific differences documented in:</em> <a href="https://workos.com/blog/scim-challenges">WorkOS "SCIM Challenges"</a>, 2024.</p>

                    </main>

                    <nav class="nav-wrapper" aria-label="Page navigation">
                        <!-- Mobile navigation buttons -->

                            <a rel="next prefetch" href="getting-started/installation.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
                                <i class="fa fa-angle-right"></i>
                            </a>

                        <div style="clear: both"></div>
                    </nav>
                </div>
            </div>

            <nav class="nav-wide-wrapper" aria-label="Page navigation">

                    <a rel="next prefetch" href="getting-started/installation.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
                        <i class="fa fa-angle-right"></i>
                    </a>
            </nav>

        </div>




        <script>
            window.playground_copyable = true;
        </script>


        <script src="elasticlunr.min.js"></script>
        <script src="mark.min.js"></script>
        <script src="searcher.js"></script>

        <script src="clipboard.min.js"></script>
        <script src="highlight.js"></script>
        <script src="book.js"></script>

        <!-- Custom JS scripts -->



    </div>
    </body>
</html>