Skip to content

Add User Management inbound SCIM provisioning sample - #391

Merged
StuFrankish merged 3 commits into
mainfrom
sf/scim-provisioning-sample
Oct 21, 2026
Merged

StuFrankish merged 3 commits into
mainfrom
sf/scim-provisioning-sample

Conversation

@StuFrankish

@StuFrankish StuFrankish commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Demonstrate how an upstream directory provisions users and groups into Duende User Management, then let a provisioned user sign in with email OTP.

The sample lives at IdentityServer/v8/UserManagement/ScimProvisioning/. Aspire connects IdentityServer, Mailpit, and a small simulated upstream directory. The Directory uses a hand-written SCIM client to demonstrate inbound provisioning; it is not a Duende outbound SCIM feature.

  • Demonstrates discovery, user creation, active=false, group membership, and Bulk requests using client credentials.
  • Allows OTP sign-in only for existing provisioned profiles, checks authenticator ownership, and verifies subject equality before issuing a session. active remains stored data and does not block sign-in.
  • Uses in-memory storage, minimal Bootstrap styling with the shared Duende overrides, and a README walkthrough.

Preview limitations

Targets User Management 2.0.0-preview.6. Includes the documented DuendeScimBearer Authority workaround for signing-key discovery and a filtered profile lookup workaround. The README also documents the missing externalId response attribute and development-only shortcuts.

Verification

Release solution build passes. Earlier local runs without a license key covered authenticated SCIM provisioning, authorization gates, Bulk and group operations, and OTP sign-in with matching provisioned/session subjects. License warnings are logged.

- Connect a simulated upstream directory to IdentityServer using Aspire and Mailpit.
- Demonstrate SCIM discovery, user and group provisioning, bulk requests, and active profile data.
- Support provisioned-only OTP sign-in with ownership and subject checks.
- Document preview limitations and apply minimal Bootstrap styling.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Resilience timeouts bypass the intended warning that provisioning changes may already have committed.

1 open issue
What changed in this PR

Adds an inbound SCIM provisioning sample to the IdentityServer v8 User Management examples, demonstrating directory provisioning followed by email OTP sign-in.

Changes:

  • Adds a simulated directory for discovery, user provisioning, groups, and Bulk requests.
  • Adds a destination with in-memory storage and provisioned-subject OTP sign-in.
  • Connects services through Aspire and documents preview limitations.

Paths below are relative to IdentityServer/v8/UserManagement/ScimProvisioning/, except root samples.slnx.

File Description
samples.slnx Registers the sample projects.
ScimProvisioning.slnx Defines the standalone solution.
ScimProvisioning.IdentityServer/​wwwroot/​lib/​bootstrap/​LICENSE Includes Bootstrap licensing.
ScimProvisioning.IdentityServer/​wwwroot/​css/​bootstrap-overrides.css Adds Duende styling.
ScimProvisioning.IdentityServer/​ScimProvisioning.IdentityServer.csproj Declares destination dependencies.
ScimProvisioning.IdentityServer/​Properties/​launchSettings.json Configures local HTTPS launch.
ScimProvisioning.IdentityServer/​Program.cs Configures SCIM, storage, and authentication.
ScimProvisioning.IdentityServer/​Pages/​Shared/​_Layout.cshtml Adds shared navigation and styling.
ScimProvisioning.IdentityServer/​Pages/​Index.cshtml.cs Loads provisioned users and groups.
ScimProvisioning.IdentityServer/​Pages/​Index.cshtml Displays records and session subject.
ScimProvisioning.IdentityServer/​Pages/​Error.cshtml Provides error guidance.
ScimProvisioning.IdentityServer/​Pages/​Account/​VerifyOtp.cshtml.cs Verifies OTP and subject before sign-in.
ScimProvisioning.IdentityServer/​Pages/​Account/​VerifyOtp.cshtml Adds code-entry form.
ScimProvisioning.IdentityServer/​Pages/​Account/​Logout.cshtml.cs Clears authentication state.
ScimProvisioning.IdentityServer/​Pages/​Account/​Logout.cshtml Adds sign-out form.
ScimProvisioning.IdentityServer/​Pages/​Account/​Login.cshtml.cs Requests OTP for existing profiles.
ScimProvisioning.IdentityServer/​Pages/​Account/​Login.cshtml Adds provisioned-user sign-in form.
ScimProvisioning.IdentityServer/​Pages/​_ViewStart.cshtml Selects shared layout.
ScimProvisioning.IdentityServer/​Pages/​_ViewImports.cshtml Enables Razor tag helpers.
ScimProvisioning.IdentityServer/​OtpCookie.cs Protects expiring OTP state.
ScimProvisioning.IdentityServer/​appsettings.json Sets issuer, SMTP, and logging defaults.
ScimProvisioning.Directory/​wwwroot/​lib/​bootstrap/​LICENSE Includes Bootstrap licensing.
ScimProvisioning.Directory/​wwwroot/​css/​bootstrap-overrides.css Adds Duende styling.
ScimProvisioning.Directory/​ScimProvisioning.Directory.csproj Declares client dependencies.
ScimProvisioning.Directory/​ScimClient.cs Implements sample SCIM operations.
ScimProvisioning.Directory/​Properties/​launchSettings.json Configures local HTTPS launch.
ScimProvisioning.Directory/​Program.cs Configures credentials and HTTP resilience.
ScimProvisioning.Directory/​Pages/​Index.cshtml.cs Handles provisioning actions and errors.
ScimProvisioning.Directory/​Pages/​Index.cshtml Presents employees and provisioning controls.
ScimProvisioning.Directory/​Pages/​Error.cshtml Provides directory error guidance.
ScimProvisioning.Directory/​Pages/​_ViewImports.cshtml Enables Razor tag helpers.
ScimProvisioning.Directory/​EmployeeDirectory.cs Seeds employees and departments.
ScimProvisioning.Directory/​appsettings.json Sets SCIM connection defaults.
ScimProvisioning.AppHost/​ScimProvisioning.AppHost.csproj References orchestrated projects.
ScimProvisioning.AppHost/​Properties/​launchSettings.json Configures dashboard launch.
ScimProvisioning.AppHost/​AppHost.cs Connects applications and Mailpit.
README.md Documents setup, walkthrough, and limitations.

Review effort: Balanced

@StuFrankish StuFrankish self-assigned this Oct 21, 2026
- Catch Polly TimeoutRejectedException so timed-out provisioning requests show the restart-before-retry warning.
@StuFrankish
StuFrankish marked this pull request as ready for review October 21, 2026 12:24
@StuFrankish
StuFrankish requested a review from a team October 21, 2026 12:24

@maartenba maartenba left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Couple of small comments.

When you do docs, can you make sure to add this to the User Management samples page as well?

Comment thread IdentityServer/v8/UserManagement/ScimProvisioning/README.md Outdated
- Remove Aspire from the opening sentence as requested in review.
@StuFrankish
StuFrankish merged commit 05a0bdc into main Oct 21, 2026
1 of 3 checks passed
@StuFrankish
StuFrankish deleted the sf/scim-provisioning-sample branch October 21, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants