










Summary: This guide provides a concrete, prioritized 10-step checklist for developers who have inherited a running Duende IdentityServer instance. The steps focus on quickly establishing operational stability and identifying risks. Key actions include verifying the license and expiration, confirming robust Data Protection and Signing Key Management configurations, locating Configuration and Operational data stores, auditing the client inventory, and checking the deployment topology and NuGet packages. The checklist emphasizes that IdentityServer is a standard ASP.NET Core application, making it manageable, and highlights available Duende support resources.
Someone left. A team restructured. Maybe your company acquired another company's codebase. Whatever the reason, you're now looking at a running instance of Duende IdentityServer that you didn't build, and you need to understand it.
Take a breath. You've got this.
Duende IdentityServer is a standard ASP.NET Core application. It uses the same dependency injection, middleware pipeline, configuration system, and hosting model you already know. There's no separate runtime, no mystery JVM, no alien technology. If you've built ASP.NET Core apps before, you already have the foundation. And if you haven't, the patterns are well documented and follow conventions used by the broader .NET ecosystem.
This post walks you through a concrete, prioritized checklist to help you get your bearings. We'll start with the things that could hurt you soonest and work toward the things that will make your life easier over time.
Your first stop should be the license. Duende IdentityServer requires a license for production use, and licenses have expiration dates.
Where to look:
appsettings.json or appsettings.Production.json for a LicenseKey property Program.cs or Startup.cs for any custom license loading code Duende_License.key in the application's ContentRootPath. If present, the file's contents will be used as the license key. What to determine:
An expired license does not immediately shut down your application. But you lose access to updates, priority support, and you're out of compliance. Check the licensing documentation for specifics on how license enforcement works in your version. If you find that a license has expired or is missing, contact Duende sales to resolve the issue. The team is used to these conversations and will work with you.
ASP.NET Core Data Protection is the cryptographic subsystem that protects cookies, anti-forgery tokens, and (critically) IdentityServer's signing keys at rest. It is the single most common source of production issues with IdentityServer deployments. If it's misconfigured, things can break in subtle, painful ways.
What can go wrong:
What to look for in Program.cs:
Three configuration calls matter for production:
Csharp
builder.Services.AddDataProtection()
.PersistKeysToAzureBlobStorage(connectionString, "data-protection", "keys.xml")
.ProtectKeysWithAzureKeyVault(keyIdentifier, credential)
.SetApplicationName("your-identity-server");The three essential calls:
PersistKeysTo*() stores keys in shared, durable storage (Azure Blob, AWS Systems Manager, a shared file system, or a database) ProtectKeysWith*() encrypts keys at rest (Azure Key Vault, a certificate, or DPAPI on Windows) SetApplicationName() creates a logical partition so multiple apps on the same storage don't collide If any of these are missing, you've found something to fix. The Data Protection guide in the Duende docs walks through every scenario with specific configuration for Azure, AWS, and self-hosted deployments.
IdentityServer uses cryptographic keys to sign tokens. Relying parties (your APIs, your clients) use the corresponding public keys to verify those tokens. If signing keys go wrong, token validation fails across your entire system.
Automatic vs. static keys:
AddSigningCredential() or AddValidationKey(). If you see this in your code, someone chose to manage keys by hand. Check whether the certificate or key is approaching expiration. Signing credentials are for the currently active signing key, while validation keys are for validating tokens issued with older keys after a manual rotation. Quick health check:
Hit the discovery endpoint in your browser:
https://your-identity-server/.well-known/openid-configuration Then follow the jwks_uri link. You should see one or more keys listed. If the keys look stale (you can check kid values over time to see if they rotate), automatic key management may be misconfigured.
What to verify:
IdentityServer uses two categories of persistent data:
Configuration data includes clients, API scopes, API resources, and identity resources. This is the "what is allowed" data that defines which applications can request tokens and what permissions are available.
Operational data includes persisted grants (refresh tokens, reference tokens, authorization codes), device codes, consent records, and server-side sessions. This data changes constantly as users authenticate.
How to figure out what you have:
Look in Program.cs for these patterns:
Csharp
// In-memory configuration (defined in code, changes require redeployment)
builder.Services.AddIdentityServer()
.AddInMemoryClients(Config.Clients)
.AddInMemoryApiScopes(Config.ApiScopes)
.AddInMemoryIdentityResources(Config.IdentityResources);
// Entity Framework (EF) Core-backed stores (configuration lives in a database)
builder.Services.AddIdentityServer()
.AddConfigurationStore(options =>
{
options.ConfigureDbContext = b =>
b.UseSqlServer(connectionString);
})
.AddOperationalStore(options =>
{
options.ConfigureDbContext = b =>
b.UseSqlServer(connectionString);
});
// ASP.NET Core Identity integration
builder.Services.AddIdentityServer()
.AddAspNetIdentity<ApplicationUser>();What this tells you:
Config.cs file). Any configuration change requires a code change and redeployment. This is common in smaller deployments but unlikely for production-deployed instances of Duende IdentityServer; this is worth double-checking if the project transitioned mid-development, as this can cause issues in multi-instance setups or when rebooting an instance. If your deployment uses EF Core stores, check whether token cleanup is configured. Operational stores grow over time as tokens are issued. Without periodic cleanup, the persisted grants table expands indefinitely:
Csharp
.AddOperationalStore(options =>
{
options.EnableTokenCleanup = true;
options.TokenCleanupInterval = 3600; // seconds
});Clients are the applications that request tokens from your IdentityServer. Each web app, mobile app, single-page application (SPA), or machine-to-machine service that authenticates through IdentityServer is registered as a client. The number of registered clients also determines your licensing requirements.
Where to find them:
Config.cs or similar file that defines IEnumerable<Client> Clients table in your configuration database What to document for each client:
ClientId and display name AllowedGrantTypes (tells you how the client authenticates: authorization code, client credentials, etc.) RedirectUris and PostLogoutRedirectUris (tells you where users go during auth flows) AllowedScopes (tells you what resources the client can access) AllowedCorsOrigins if any clients are browser-based SPAs (misconfigured CORS silently blocks token requests) This inventory is your map. It tells you which applications depend on this IdentityServer instance and would break if it were to go down.
Open the .csproj file and look at the Duende package references:
Xml
<PackageReference Include="Duende.IdentityServer" Version="7.1.0" />
<PackageReference Include="Duende.IdentityServer.EntityFramework" Version="7.1.0" /> Critical rule: all Duende packages must be the same major version. Mixing versions (for example, Duende.IdentityServer 7.x with Duende.IdentityServer.EntityFramework 6.x) leads to runtime errors that can be difficult to diagnose.
Also check:
net6.0 or net7.0, those runtimes are out of support. If you're running an older version, don't panic. IdentityServer is stable and doesn't stop working because a newer version exists. But you should plan an upgrade path to stay on supported .NET runtimes and receive security patches.
IdentityServer is highly extensible, and the previous team may have used that extensibility. Customizations change the behavior of the system in ways that won't be obvious from configuration alone.
Common customizations to search for:
IProfileService implementation: Controls which claims are included in tokens. Search your codebase for IProfileService. If there's a custom implementation, it's shaping every token your server issues. IExtensionGrantValidator): Allow non-standard authentication flows. If one exists, it's implementing custom business logic in the token endpoint. IEventSink): Capture authentication events for audit logging. Check whether events are being shipped to a logging system like Seq, Application Insights, or an Elasticsearch/Logstash/Kibana (ELK) stack. IClientStore, IResourceStore, or IPersistedGrantStore directly instead of using the built-in stores, the data source could be anywhere. Program.cs for custom middleware in the pipeline that might intercept or modify requests before they reach IdentityServer. Each customization you find is a piece of institutional knowledge held by the previous team. Document what you find.
If the previous team configured health checks, you have a head start on monitoring. ASP.NET Core health checks are the standard approach:
Csharp
builder.Services.AddHealthChecks()
.AddCheck("discovery", () =>
{
// Verify discovery endpoint is responding
// ...
})
.AddCheck("jwks", () =>
{
// Verify signing keys are accessible
// ...
});Also look for:
RaiseSuccessEvents, RaiseFailureEvents, RaiseInformationEvents, and RaiseErrorEvents set to true in the IdentityServer options? These events are your audit trail. If none of this exists, adding health checks and enabling events should be one of your first improvements. The deployment documentation covers health check patterns for monitoring discovery endpoints, signing key availability, and license status.
Understanding how the server is deployed tells you where operational risks live.
Questions to answer:
Now that you've inventoried the system, build up your understanding of the identity concepts behind it.
Essential reading:
Training options:
Understanding the protocols behind IdentityServer (OpenID Connect and OAuth 2.0) will pay dividends. You don't need to become a protocol expert, but knowing the basics of authorization code flow, client credentials, refresh tokens, and token validation will make everything else click.
Some issues don't announce themselves until they've already caused a problem. Here's what to watch:
| Risk | What Happens | How to Check |
|---|---|---|
| Expired license | No immediate impact, but you lose update and support rights | Check the license key expiration date |
| Data Protection key loss | All users get logged out; tokens become invalid | Verify keys are persisted to durable, shared storage |
| Stale signing keys | If rotation is broken, keys age indefinitely; compromise risk grows | Monitor the JWKS endpoint for key rotation |
| Unbounded token tables | Operational database grows until queries slow down or disk fills | Check EnableTokenCleanup in operational store config |
| Cookie size growth | Adding claims, roles, or external provider data can push cookies past reverse proxy limits | Test with production-like claim sets behind your actual proxy |
| Outdated .NET runtime | .NET 6 and 7 are end-of-life; no security patches | Check TargetFramework in the .csproj |
| Azure SQL + EF Core version mismatch | Specific versions of Microsoft.Data.SqlClient causes severe connection pool issues and CPU spikes on Azure SQL | Check SqlClient version and known issue advisories |
Inheriting an identity system can feel overwhelming. It's the security backbone of your entire application ecosystem, and nobody left you a manual. That's a tough spot.
But here's the thing: the system is working right now. Users are logging in. Tokens are being issued. APIs are validating them. You don't need to fix everything today. You need to understand what you have, identify the risks, and make a plan.
Duende support is here. Every license tier includes access to help:
For bigger challenges, our partners are ready. When you need an architecture review, implementation help, or someone to dig into a complex codebase, our global network of certified partners specializes in exactly that. These firms know Duende products well and work with organizations of all sizes. Whether you need a few hours of expert guidance or a full implementation engagement, they can meet you where you are.
Here's a condensed version of everything above. Print it, check things off, and move at whatever pace your situation allows.
IProfileService? Custom grants? Event sinks? You didn't choose this situation, but you're the right person to handle it. The technology is solid, the documentation is thorough, and help is available at every level. Take it one step at a time.
You've got this ❤️
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。