identityserver-hosting-setup

Configure Duende IdentityServer hosting in ASP.NET Core with DI and middleware.

10|2|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/DuendeSoftware/duende-skills --skill identityserver-hosting-setup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: identityserver-hosting-setup
Source: https://github.com/DuendeSoftware/duende-skills/tree/main/skills/identityserver-hosting-setup
Command: npx skills add https://github.com/DuendeSoftware/duende-skills --skill identityserver-hosting-setup

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Setting up and hosting Duende IdentityServer in ASP.NET Core applications, including DI registration, middleware pipeline configuration, hosting patterns, license handling, and ASP.NET Identity integration.

Core Features & Use Cases

  • Comprehensive guidance on DI registration, middleware ordering, hosting patterns (separate vs shared), license configuration, and Identity integration for production deployments.
  • Step-by-step instructions to create minimal projects, configure essential options, and ensure secure, scalable deployments in real-world scenarios.

Quick Start

Create a new IdentityServer project using the provided template and wire up DI, middleware, and hosting as described.

Frequently Asked Questions about identityserver-hosting-setup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I host IdentityServer in an ASP.NET Core application?

To host IdentityServer in ASP.NET Core, you must configure DI registration using AddIdentityServer and set up the middleware pipeline with UseIdentityServer in the correct order. This ensures secure middleware sequencing and proper service registration for production deployments.

What is the correct middleware ordering for Duende IdentityServer in ASP.NET Core?

Proper middleware ordering places UseIdentityServer at the correct position in the ASP.NET Core pipeline to ensure secure sequencing. Correct DI registration via AddIdentityServer is also required before the middleware can handle authentication requests safely.

How do I integrate ASP.NET Identity with Duende IdentityServer?

You integrate ASP.NET Identity with Duende IdentityServer by calling AddAspNetIdentity during DI registration. This configures the shared hosting pattern to manage user authentication alongside IdentityServer's protocol handling seamlessly.

Should I host IdentityServer in a separate project or share it with my main application?

IdentityServer supports both separate and shared hosting patterns. A separate project isolates security concerns, while a shared application uses AddAspNetIdentity to combine IdentityServer with your existing ASP.NET Core user interface and APIs.

Do I need to configure forward headers and data protection for IdentityServer?

Configuring forward headers and data protection is required for secure IdentityServer deployments. This setup ensures correct client IP resolution and consistent authentication ticket handling across multiple application instances.

How do I manage the license key when setting up Duende IdentityServer?

License key management is part of configuring Duende IdentityServer during the DI registration phase. You must apply the license key correctly to satisfy production deployment requirements and remove the developer license warning.