|
| 1 | +--- |
| 2 | +title: "Conformance Report" |
| 3 | +description: How to install, configure, and use the IdentityServer conformance report to assess OAuth 2.1 and FAPI 2.0 compliance. |
| 4 | +date: 2026-03-02 |
| 5 | +sidebar: |
| 6 | + label: Conformance Report |
| 7 | + order: 50 |
| 8 | + badge: |
| 9 | + text: v8.0 |
| 10 | + variant: tip |
| 11 | +--- |
| 12 | + |
| 13 | +The conformance report assesses your IdentityServer deployment against |
| 14 | +[OAuth 2.1](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1) and |
| 15 | +[FAPI 2.0 Security Profile](https://openid.net/specs/fapi-2_0-security-profile.html) specifications, |
| 16 | +generating an HTML report accessible via a protected endpoint. |
| 17 | + |
| 18 | +## Installation |
| 19 | + |
| 20 | +Install the NuGet package: |
| 21 | + |
| 22 | +```bash title="Terminal" |
| 23 | +dotnet add package Duende.IdentityServer.ConformanceReport |
| 24 | +``` |
| 25 | + |
| 26 | +## Setup |
| 27 | + |
| 28 | +### 1. Register the Conformance Report |
| 29 | + |
| 30 | +Call `AddConformanceReport()` on the IdentityServer builder: |
| 31 | + |
| 32 | +```csharp |
| 33 | +// Program.cs |
| 34 | +builder.Services.AddIdentityServer() |
| 35 | + .AddConformanceReport(options => |
| 36 | + { |
| 37 | + options.Enabled = true; |
| 38 | + }); |
| 39 | +``` |
| 40 | + |
| 41 | +### 2. Map the Endpoint |
| 42 | + |
| 43 | +Add the conformance report endpoint to your middleware pipeline: |
| 44 | + |
| 45 | +```csharp |
| 46 | +// Program.cs |
| 47 | +app.MapConformanceReport(); |
| 48 | +``` |
| 49 | + |
| 50 | +### 3. Access the Report |
| 51 | + |
| 52 | +Navigate to: `https://your-server/_duende/conformance-report` |
| 53 | + |
| 54 | +The endpoint requires an authenticated user by default (see [Authorization](#authorization) below). |
| 55 | + |
| 56 | +## Configuration Options |
| 57 | + |
| 58 | +`ConformanceReportOptions` controls the conformance report feature: |
| 59 | + |
| 60 | +| Property | Type | Default | Description | |
| 61 | +| ------------------------------- | ------------------------------------- | --------------------------- | ---------------------------------------------------------------- | |
| 62 | +| `Enabled` | `bool` | `false` | Enable or disable the conformance report endpoint. | |
| 63 | +| `EnableOAuth21Assessment` | `bool` | `true` | Include OAuth 2.1 profile assessment in the report. | |
| 64 | +| `EnableFapi2SecurityAssessment` | `bool` | `true` | Include FAPI 2.0 Security Profile assessment in the report. | |
| 65 | +| `PathPrefix` | `string` | `"_duende"` | URL path prefix for the conformance endpoint (no leading slash). | |
| 66 | +| `ConfigureAuthorization` | `Action<AuthorizationPolicyBuilder>?` | Requires authenticated user | Authorization policy for the HTML report endpoint. | |
| 67 | +| `AuthorizationPolicyName` | `string` | `"ConformanceReport"` | ASP.NET Core authorization policy name used internally. | |
| 68 | +| `HostCompanyName` | `string?` | `null` | Optional company name shown in the report header. | |
| 69 | +| `HostCompanyLogoUrl` | `Uri?` | `null` | Optional company logo URL shown in the report header. | |
| 70 | + |
| 71 | +## Authorization |
| 72 | + |
| 73 | +By default, the report endpoint requires an authenticated user. Customize the policy using |
| 74 | +`ConfigureAuthorization`: |
| 75 | + |
| 76 | +```csharp |
| 77 | +// Program.cs |
| 78 | +builder.Services.AddIdentityServer() |
| 79 | + .AddConformanceReport(options => |
| 80 | + { |
| 81 | + options.Enabled = true; |
| 82 | + |
| 83 | + // Require a specific role |
| 84 | + options.ConfigureAuthorization = policy => policy.RequireRole("Admin"); |
| 85 | + |
| 86 | + // Or require multiple conditions |
| 87 | + // options.ConfigureAuthorization = policy => policy |
| 88 | + // .RequireRole("Admin") |
| 89 | + // .RequireClaim("department", "IT"); |
| 90 | +
|
| 91 | + // Or allow anonymous (development/testing only) |
| 92 | + // options.ConfigureAuthorization = policy => |
| 93 | + // policy.RequireAssertion(_ => builder.Environment.IsDevelopment()); |
| 94 | + }); |
| 95 | +``` |
| 96 | + |
| 97 | +:::caution |
| 98 | +If you set `ConfigureAuthorization = null`, you must manually register an ASP.NET Core authorization |
| 99 | +policy with the name specified in `AuthorizationPolicyName` (default: `"ConformanceReport"`). |
| 100 | +Otherwise, the endpoint will fail at runtime with a "policy not found" error. |
| 101 | +::: |
| 102 | + |
| 103 | +## Understanding the Report |
| 104 | + |
| 105 | +The HTML report displays: |
| 106 | + |
| 107 | +* **Server Configuration** — a matrix of server-level conformance rules and their status |
| 108 | +* **Client Configurations** — a matrix of per-client conformance rules and their status |
| 109 | +* **Rule Legend** — explanation of each rule identifier |
| 110 | +* **Notes** — detailed messages for warnings and failures |
| 111 | + |
| 112 | +### Status Indicators |
| 113 | + |
| 114 | +| Symbol | Meaning | |
| 115 | +| ------- | -------------------------------------------------------- | |
| 116 | +| Pass | Requirement is met | |
| 117 | +| Fail | Requirement is not met (configuration is non-conformant) | |
| 118 | +| Warning | Recommended practice is not followed | |
| 119 | +| N/A | Rule is not applicable to this configuration | |
| 120 | + |
| 121 | +## Requirements |
| 122 | + |
| 123 | +The conformance report uses `IClientStore.GetAllClientsAsync` to enumerate all clients for |
| 124 | +assessment. Custom `IClientStore` implementations must implement this method (added in v8.0). |
| 125 | +See the [upgrade guide](/identityserver/upgrades/v7_4-to-v8_0/#iclientstoregettallclientsasync-now-required) |
| 126 | +for details. |
| 127 | + |
| 128 | +## Full Example |
| 129 | + |
| 130 | +```csharp |
| 131 | +// Program.cs |
| 132 | +
|
| 133 | +builder.Services.AddIdentityServer() |
| 134 | + .AddInMemoryClients(Config.Clients) |
| 135 | + .AddConformanceReport(options => |
| 136 | + { |
| 137 | + options.Enabled = true; |
| 138 | + options.EnableOAuth21Assessment = true; |
| 139 | + options.EnableFapi2SecurityAssessment = true; |
| 140 | + options.HostCompanyName = "Acme Corp"; |
| 141 | + options.ConfigureAuthorization = policy => policy.RequireRole("ComplianceTeam"); |
| 142 | + }); |
| 143 | + |
| 144 | +// ... |
| 145 | +
|
| 146 | +app.MapConformanceReport(); |
| 147 | +app.UseIdentityServer(); |
| 148 | +``` |
0 commit comments