Add Duende Storage configuration sample - #380
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new IdentityServer v8 sample that demonstrates storing IdentityServer configuration and operational data in Duende.Storage (SQLite in-memory) and managing configuration via the Duende administration APIs, including an allowed_region client extension property enforced during token requests.
Changes:
- Introduces a new
/IdentityServer/v8/Storagesample project and dedicated solution entry. - Adds sample startup/seed logic, minimal UI, and admin-protected endpoints for querying clients and server-side sessions.
- Implements a custom token request validator + simulated request-region resolver to enforce
allowed_region.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| samples.slnx | Adds the new Storage sample folder + project to the main repo solution index. |
| IdentityServer/v8/Storage/Storage.slnx | Defines a dedicated solution entry for the Storage sample. |
| IdentityServer/v8/Storage/Storage.csproj | New web project targeting net10.0 with Duende/SQLite package references and overrides. |
| IdentityServer/v8/Storage/Program.cs | Configures IdentityServer + Duende Storage, seeds via admin APIs, and exposes sample endpoints/flows. |
| IdentityServer/v8/Storage/SampleData.cs | Seeds API scopes, identity resources, and clients (incl. typed allowed_region extended property). |
| IdentityServer/v8/Storage/AllowedRegionTokenRequestValidator.cs | Enforces stored allowed_region against the simulated request header. |
| IdentityServer/v8/Storage/SimulatedRequestRegionResolver.cs | Resolves X-Simulated-Region from the current HTTP request. |
| IdentityServer/v8/Storage/SampleUsers.cs | Defines the single in-memory test user used by the sample. |
| IdentityServer/v8/Storage/SamplePage.cs | Generates the sample home page HTML describing scenarios and curl examples. |
| IdentityServer/v8/Storage/Pages/Account/Login.cshtml.cs | Implements the compact Razor Pages login handler for the sample. |
| IdentityServer/v8/Storage/Pages/Account/Login.cshtml | Provides the compact login page markup/styles. |
| IdentityServer/v8/Storage/Pages/_ViewImports.cshtml | Enables MVC tag helpers for the Razor Pages views. |
| IdentityServer/v8/Storage/Properties/launchSettings.json | Adds a runnable launch profile + SampleBaseUrl environment variable for local execution. |
| IdentityServer/v8/Storage/README.md | Documents sample purpose, scenarios, and how to run and exercise the flows. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
maartenba
added a commit
to DuendeSoftware/docs.duendesoftware.com
that referenced
this pull request
Sep 9, 2026
…guration and operational data on Duende Storage Mirror the Spaces samples addition (023ae07) for the Duende Storage sample from DuendeSoftware/samples#380: - Add samples/storage.mdx describing the runnable Duende Storage sample - Cross-link the sample from the Duende Storage overview CardGrid - Add a Sample section to the Duende Storage getting-started guide
maartenba
approved these changes
Sep 9, 2026
- Configure IdentityServer with shared in-memory SQLite storage and fixed extension schemas - Seed and query clients and resources through administration APIs - Demonstrate token, session, client search, and allowed-region scenarios - Add a branded sample login flow and documentation
- Reject configured paths, query strings, and fragments - Clarify SampleBaseUrl requirement as an HTTPS loopback origin
Erwinvandervalk
force-pushed
the
sf/duende-storage-sample
branch
from
September 10, 2026 07:09
26af7b9 to
99ae0c5
Compare
Erwinvandervalk
pushed a commit
to DuendeSoftware/docs.duendesoftware.com
that referenced
this pull request
Sep 10, 2026
…guration and operational data on Duende Storage Mirror the Spaces samples addition (023ae07) for the Duende Storage sample from DuendeSoftware/samples#380: - Add samples/storage.mdx describing the runnable Duende Storage sample - Cross-link the sample from the Duende Storage overview CardGrid - Add a Sample section to the Duende Storage getting-started guide
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This sample demonstrates how IdentityServer configuration and operational data can be stored in Duende.Storage and managed through the administration APIs.
Summary
allowed_regionclient extension property and enforce it in a custom token request validator.Notes
The simulated
X-Simulated-Regionrequest header is intentionally caller-controlled for demonstration purposes and is not a production trust source. Preview package overrides are scoped to this sample, including a patched SQLite native dependency version.