duendesoftware/duende-skills/identityserver-configuration
Claude Code and agent skill by duendesoftware/duende-skills
- community
Checking that the SKILL.md file is still in the repository.
Configure Duende IdentityServer including client definitions, API resources, identity resources, scopes, signing credentials, and server-side sessions. Covers client types (M2M, interactive, SPA), grant types, API Scopes vs API Resources vs Identity Resources, secret management, and client authentication methods. Includes both in-memory and database-backed configuration.
Install
npx vskill@latest install duendesoftware/duende-skills/identityserver-configurationSKILL.md
The same SKILL.md was published earlier as duendesoftware/duende-skills/identityserver-configuration.
Duende IdentityServer Configuration
When to Use This Skill
Use this skill when:
- Setting up a new Duende IdentityServer host
- Defining or modifying client registrations
- Configuring API resources, API scopes, or identity resources
- Setting up signing key management (automatic or static)
- Enabling server-side sessions
- Tuning
IdentityServerOptionsfor production deployments - Migrating from IdentityServer4 to Duende IdentityServer
Core Principles
- Authorization Code + PKCE by Default — Use
GrantTypes.Codefor all interactive clients. Never use implicit flow for new applications. - Least Privilege Scopes — Grant clients only the scopes they need. Avoid wildcard or overly broad scope assignments.
- Automatic Key Management — Prefer the built-in automatic key rotation over static key configuration in production.
- API Resources for Audience Isolation — Use
ApiResourceto control theaudclaim and isolate API boundaries. UseApiScopefor fine-grained permission modeling within those boundaries. - Server-Side Sessions for Enterprise — Enable server-side sessions when you need centralized session management, back-channel logout, or session queries.
Related Skills
identityserver-duende-storage— opt-in Duende Storage provider (preview), admin APIs for clients/resourcesidentityserver-spaces— multi-tenancy with isolated data per space (preview)
identityserver-stores— EF Core persistence for configuration and operational dataoauth-oidc-protocols— Protocol fundamentals that underpin these configuration choicesidentity-security-hardening— Production hardening of IdentityServer deploymentstoken-management— Client-side token lifecycle with Duende.AccessTokenManagementaspnetcore-authentication— Configuring OIDC authentication in client applications
Docs: https://docs.duendesoftware.com/identityserver/configuration
Sub-Documents
Load these sub-documents when the user's question specifically targets one of these areas:
| Document | Description | When to Load | |
|---|---|---|---|
| docs/client-types.md | Grant type selection matrix, client property reference tables, client authentication methods (shared secret, private_key_jwt, mTLS), secret rollover, and CORS | private_key_jwt, mTLS, secret rotation, refresh token settings, client authentication, CORS origins | |
| docs/resources-scopes.md | Resource type decision matrix, identity resources, API scopes (including parameterized scopes), and API resources with audience isolation | aud claim, audience isolation, parameterized scopes, IScopeParser, IResourceValidator, EmitStaticAudienceClaim, API Resources, Identity Resources |
Pattern 1: Hosting and Basic Setup
Register Duende IdentityServer in Program.cs with AddIdentityServer. All configuration flows from the IdentityServerOptions lambda and the builder's fluent API.
Important: CallUseIdentityServer()instead ofUseAuthentication()— it registers both the IdentityServer middleware and the authentication middleware.
Pattern 2: Client Definitions
Clients represent applications that request tokens. The three most common configurations are:
Machine-to-Machine (Client Credentials)
For service-to-service communication with no interactive user:
Interactive Web Application (Authorization Code + PKCE)
For server-rendered web apps that authenticate users and call APIs:
SPA with BFF Pattern
For JavaScript SPAs using the Backend-for-Frontend pattern (see duende-bff skill):
Key Client Properties
| Property | Purpose | Default | |
|---|---|---|---|
RequirePkce | Enforce PKCE for authorization code flow | true | |
AllowOfflineAccess | Enable refresh token issuance | false | |
AccessTokenLifetime | Access token duration in seconds | 3600 (1 hour) | |
IdentityTokenLifetime | Identity token duration in seconds | 300 (5 min) | |
RefreshTokenUsage | ReUse or OneTimeOnly | ReUse (recommend OneTimeOnly for security) | |
RefreshTokenExpiration | Absolute or Sliding | Absolute | |
AbsoluteRefreshTokenLifetime | Max refresh token lifetime in seconds | 2592000 (30 days) | |
AllowedCorsOrigins | CORS origins for token endpoint calls | empty | |
RequireConsent | Show consent screen | false | |
CoordinateLifetimeWithUserSession | Tie token lifetimes to user session | false |
Defining Clients in appsettings.json
For scenarios where client configuration should be externalized:
Pattern 3: Identity Resources
Identity resources define groups of claims about users, requested via the scope parameter. They map to claims in the identity token and the userinfo endpoint.
Standard Identity Resources
Custom Identity Resources
Define custom identity resources for application-specific user claims:
Key concept: Theopenidscope is mandatory for any OpenID Connect request. It tells IdentityServer to return thesub(subject ID) claim.
Pattern 4: API Scopes and API Resources
API scopes and API resources work together to model your API surface area. Understanding the distinction is critical.
API Scopes — Permission Model
An ApiScope represents a permission or capability a client can request:
API Resources — Logical API Boundaries
An ApiResource represents a logical API (typically a deployed service). It groups scopes and controls the aud (audience) claim in access tokens:
When to Use ApiResource vs ApiScope
| Scenario | Use ApiScope alone? | Add ApiResource? | |
|---|---|---|---|
| Single API, simple permissions | ✅ Sufficient | Optional | |
| Multiple APIs sharing a scope | ❌ | ✅ Required for audience isolation | |
| Reference token introspection | ❌ | ✅ Required for API secrets | |
| Per-API signing algorithms | ❌ | ✅ Use AllowedTokenSigningAlgorithms | |
| Resource isolation (RFC 8707) | ❌ | ✅ Required |
Resource Isolation
When multiple APIs share scope names, resource isolation prevents a token issued for one API from being used at another:
With resource isolation, the client specifies the target resource in the token request using the resource parameter (RFC 8707), and IdentityServer issues a token with a single audience.
Pattern 5: Automatic Key Management
Duende IdentityServer's automatic key management handles signing key creation, rotation, and retirement. This is the recommended approach for production.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/identityserver-configuration/SKILL.md
Popularity
- Repository stars
- 9
- Repository forks
- 3
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/duendesoftware/duende-skills/identityserver-configuration)