Skip to content

Commit 6eab4f3

Browse files
authored
Merge pull request #993 from DuendeSoftware/mb/is4-analysis
IdentityServer4 to Duende IdentityServer - Upgrade Analysis
2 parents 5cccc62 + d0f5ea2 commit 6eab4f3

7 files changed

Lines changed: 572 additions & 3 deletions

src/content/docs/identityserver/upgrades/code/MigrationAnalysisController.cs

Lines changed: 482 additions & 0 deletions
Large diffs are not rendered by default.

src/content/docs/identityserver/upgrades/identityserver4-to-duende-identityserver-v7.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ import { Tabs, TabItem } from "@astrojs/starlight/components";
1212
This upgrade guide covers upgrading from IdentityServer4 to Duende IdentityServer v7.4.
1313
IdentityServer4 reached its end of life (EOL) on December 13, 2022. It is strongly advised to migrate to Duende IdentityServer.
1414

15+
:::tip[IdentityServer4 Migration Analysis]
16+
Start your upgrade with this step-by-step migration guide, and use our automated [IdentityServer4 Migration Analysis Tool](/identityserver/upgrades/identityserver4-upgrade-analysis.mdx)
17+
tool to help identify important aspects of your upgrade to Duende IdentityServer.
18+
19+
We also offer a [free IdentityServer4 upgrade assessment](https://duendesoftware.com/upgrade-identityserver4) to walk you through your upgrade path.
20+
:::
21+
1522
Depending on your current version of IdentityServer4, different steps may be required.
1623
You can determine the version of IdentityServer4 by running the `dotnet list` command at the root of your IdentityServer host project, or using NuGet tooling in Visual Studio or JetBrains Rider.
1724

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
title: "IdentityServer4 to Duende IdentityServer - Migration Analysis Tool"
3+
sidebar:
4+
order: 139
5+
label: IdentityServer4 Migration Analysis
6+
---
7+
8+
import { Code } from "@astrojs/starlight/components";
9+
import { Steps } from "@astrojs/starlight/components";
10+
import { Tabs, TabItem } from "@astrojs/starlight/components";
11+
12+
To help assist in planning the [migration of an IdentityServer4 implementation to Duende IdentityServer](/identityserver/upgrades/identityserver4-to-duende-identityserver-v7.mdx),
13+
we provide a utility that [analyzes the current configuration of your current IdentityServer4](https://raw.githubusercontent.com/DuendeSoftware/docs.duendesoftware.com/refs/heads/main/src/content/docs/identityserver/upgrades/code/MigrationAnalysisController.cs).
14+
It inspects the running instance to provide specific recommendations and highlights potential compatibility issues during the upgrade and migration process.
15+
16+
Note that the data provided is informative and should not be considered a complete migration plan.
17+
18+
:::note
19+
We also offer a [free IdentityServer4 upgrade assessment](https://duendesoftware.com/upgrade-identityserver4) to walk you through your upgrade path.
20+
:::
21+
22+
## Installation
23+
24+
This Migration Analysis tool is provided as a single file, [`MigrationAnalysisController.cs`](https://raw.githubusercontent.com/DuendeSoftware/docs.duendesoftware.com/refs/heads/main/src/content/docs/identityserver/upgrades/code/MigrationAnalysisController.cs), which can be [downloaded](https://raw.githubusercontent.com/DuendeSoftware/docs.duendesoftware.com/refs/heads/main/src/content/docs/identityserver/upgrades/code/MigrationAnalysisController.cs)
25+
and added directly to any existing IdentityServer4 project. It does not require a separate library or complex installation process.
26+
27+
The tool's code was deliberately kept rudimentary and compatible with earlier C# versions to ensure maximum compatibility with older projects.
28+
29+
The controller is designed to inspect client configurations from:
30+
1. **In-Memory Clients**
31+
2. **Entity Framework Core** (standard `IdentityServer4.EntityFramework` stores)
32+
33+
If your implementation uses a custom store for client configuration, you will need to modify the controller code (specifically in the constructor) to manually wire up the retrieval of your client data so it can be included in the analysis.
34+
35+
:::danger[Security warning]
36+
To make use of the tool, you must update the authorization logic in the `Index()` method. Authorization is in place to ensure that only a user with the necessary claims can access the report for your environment.
37+
This is extremely important when deploying the migration analysis tool to your production environment.
38+
39+
The default implementation contains a placeholder check that verifies if your username is `"scott"`:
40+
```csharp {3}
41+
// MigrationAnalysisController.cs
42+
// Verify user is allowed to access this page
43+
if (User.Identity == null || User.Identity.Name != "scott")
44+
{
45+
return Unauthorized();
46+
}
47+
```
48+
49+
You must replace this with checks for specific user characteristics (e.g., role, claim, or username) to ensure that only authorized users can access this sensitive information.
50+
:::
51+
52+
## Usage
53+
54+
To use the tool:
55+
1. Ensure the IdentityServer4 host is running.
56+
2. Navigate to the `/MigrationAnalysis` endpoint of your IdentityServer4 host in your browser (e.g., `https://localhost:5001/MigrationAnalysis`).
57+
3. Ensure you are logged in with a user that meets the security criteria defined in the `Index()` method.
58+
59+
## Analysis Report
60+
61+
The Analysis page provides a table with the following data points and recommendations:
62+
63+
* **.NET Version:** Checks the runtime version and recommends upgrading to the latest LTS if needed.
64+
* **IdentityServer4 Version:** Verifies the current version. Migration to Duende IdentityServer typically requires being on IdentityServer4 v4.x first.
65+
* **Clients:** Provides information about interactive and non-interactive clients. This information is important for [determining the appropriate license edition for Duende IdentityServer](https://duendesoftware.com/products/identityserver/).
66+
* **Issuer URI:** Reports the current issuer URI, if configured.
67+
* **Signing Credential Store:** Identifies the type of store used for signing credentials and checks for compatibility.
68+
* **Signing Key:** Displays the current Key ID and links to documentation on migrating signing keys.
69+
* **Data Protection:**
70+
* **Application Name:** Checks if the Application Discriminator is set, which is crucial for key isolation.
71+
* **Repository Type:** Verifies where keys are stored (e.g., XML repository) to ensure they are persisted correctly in production.
72+
* **Authentication Schemes:** Lists all registered authentication handlers and highlights those that might not be compatible with newer ASP.NET Core versions.
73+
74+
![IdentityServer4 to Duende IdentityServer migration analysis](images/migration-analysis.png)
75+
76+
With this information, you can [start your IdentityServer4 to Duende IdentityServer migration](/identityserver/upgrades/identityserver4-to-duende-identityserver-v7.mdx) more informed.

src/content/docs/identityserver/upgrades/identityserver4-v3-to-identityserver4-v4.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "IdentityServer4 v3.1 to IdentityServer4 v4.1"
33
sidebar:
4-
order: 140
4+
order: 151
55
label: IdentityServer4 v3.1 → v4.1
66
redirect_from:
77
- /identityserver/v5/upgrades/is4_v3_to_dis_v5/

src/content/docs/identityserver/upgrades/identityserver4-v4-to-duende-identityserver-v6.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "IdentityServer4 v4.1 to Duende IdentityServer v6"
33
sidebar:
4-
order: 139
4+
order: 150
55
label: IdentityServer4 v4.1 → v6.0
66
redirect_from:
77
- /identityserver/v5/upgrades/is4_v4_to_dis_v5/
170 KB
Loading

src/content/docs/identityserver/upgrades/index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,8 @@ Then continue with "Upgrading from version 6.3" below.
7474

7575
#### Upgrading from version 6.3
7676

77-
Follow the [upgrade guide version 6.3 - 7.0](/identityserver/upgrades/v6_3-to-v7_0.md)
77+
Follow the [upgrade guide version 6.3 - 7.0](/identityserver/upgrades/v6_3-to-v7_0.md)
78+
79+
## Upgrading from IdentityServer4 to Duende IdentityServer
80+
81+
See [IdentityServer4 to Duende IdentityServer](/identityserver/upgrades/identityserver4-to-duende-identityserver-v7.mdx).

0 commit comments

Comments
 (0)