Skip to content

Add Duende Storage configuration sample - #380

Merged
Erwinvandervalk merged 2 commits into
mainfrom
sf/duende-storage-sample
Sep 10, 2026
Merged

Erwinvandervalk merged 2 commits into
mainfrom
sf/duende-storage-sample

Conversation

@StuFrankish

@StuFrankish StuFrankish commented Sep 9, 2026

Copy link
Copy Markdown
Member

This sample demonstrates how IdentityServer configuration and operational data can be stored in Duende.Storage and managed through the administration APIs.

Summary

  • Host IdentityServer with a shared in-memory SQLite store and a fixed in-memory client extension schema.
  • Seed API scopes, identity resources, and clients through the administration APIs.
  • Demonstrate client-credentials token issuance, authorization code with PKCE, storage-backed server-side sessions, and authenticated client and session searches.
  • Define an allowed_region client extension property and enforce it in a custom token request validator.
  • Include a compact login page, runnable launch profile, dedicated solution, and setup documentation.

Notes

The simulated X-Simulated-Region request 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.

@StuFrankish StuFrankish self-assigned this Sep 9, 2026
@StuFrankish
StuFrankish marked this pull request as ready for review September 9, 2026 09:37
@StuFrankish
StuFrankish requested a lite review from Copilot September 9, 2026 09:37

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.

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/Storage sample 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.

Comment thread IdentityServer/v8/Storage/Program.cs
Comment thread IdentityServer/v8/Storage/Program.cs
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
- 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
Erwinvandervalk merged commit 730c979 into main Sep 10, 2026
0 of 2 checks passed
@Erwinvandervalk
Erwinvandervalk deleted the sf/duende-storage-sample branch September 10, 2026 07:12
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
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.

4 participants