Skip to content

Commit

Permalink
Fix client compilation issues
Browse files Browse the repository at this point in the history
- Duende.IdentityModel.OidcClient does not exist (yet), so switch back to IdentityModel.OidcClient
- Fix usage of DCR extensions to be compatible with latest IdentityModel
  • Loading branch information
josephdecock committed Dec 6, 2024
1 parent 9ee9179 commit df25289
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"name": "host: main (dotnet 8)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build-host-main",
"preLaunchTask": "build-host-main-8",
"program": "${workspaceFolder}/hosts/main/bin/Debug/net8.0/Host.Main.dll",
"args": [],
"cwd": "${workspaceFolder}/hosts/main",
Expand Down Expand Up @@ -64,7 +64,7 @@
"name": "host: AspNetIdentity (dotnet 8)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build-host-aspnetidentity",
"preLaunchTask": "build-host-aspnetidentity-8",
"program": "${workspaceFolder}/hosts/AspNetIdentity/bin/Debug/net8.0/Host.AspNetIdentity.dll",
"args": [],
"cwd": "${workspaceFolder}/hosts/AspNetIdentity",
Expand Down Expand Up @@ -100,7 +100,7 @@
"name": "host: EntityFramework (dotnet 8)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build-host-entityframework",
"preLaunchTask": "build-host-entityframework-8",
"program": "${workspaceFolder}/hosts/EntityFramework/bin/Debug/net8.0/Host.EntityFramework.dll",
"args": [],
"cwd": "${workspaceFolder}/hosts/EntityFramework",
Expand Down Expand Up @@ -136,7 +136,7 @@
"name": "host: Configuration (dotnet 8)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build-host-configuration",
"preLaunchTask": "build-host-configuration-8",
"program": "${workspaceFolder}/hosts/Configuration/bin/Debug/net8.0/Host.Configuration.dll",
"args": [],
"cwd": "${workspaceFolder}/hosts/Configuration",
Expand Down
56 changes: 56 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,48 +20,104 @@
//-------
// Hosts
//-------
{
"label": "build-host-main-8",
"type": "process",
"command": "dotnet",
"args": [
"build",
"--framework=net8.0",
"${workspaceFolder}/hosts/main/Host.Main.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "build-host-main",
"type": "process",
"command": "dotnet",
"args": [
"build",
"--framework=net9.0",
"${workspaceFolder}/hosts/main/Host.Main.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "build-host-entityframework-8",
"type": "process",
"command": "dotnet",
"args": [
"build",
"--framework=net8.0",
"${workspaceFolder}/hosts/EntityFramework/Host.EntityFramework.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "build-host-entityframework",
"type": "process",
"command": "dotnet",
"args": [
"build",
"--framework=net9.0",
"${workspaceFolder}/hosts/EntityFramework/Host.EntityFramework.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "build-host-aspnetidentity-8",
"type": "process",
"command": "dotnet",
"args": [
"build",
"--framework=net8.0",
"${workspaceFolder}/hosts/AspNetIdentity/Host.AspNetIdentity.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "build-host-aspnetidentity",
"type": "process",
"command": "dotnet",
"args": [
"build",
"--framework=net9.0",
"${workspaceFolder}/hosts/AspNetIdentity/Host.AspNetIdentity.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "build-host-configuration-8",
"type": "process",
"command": "dotnet",
"args": [
"build",
"--framework=net8.0",
"${workspaceFolder}/hosts/Configuration/Host.Configuration.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "build-host-configuration",
"type": "process",
"command": "dotnet",
"args": [
"build",
"--framework=net9.0",
"${workspaceFolder}/hosts/Configuration/Host.Configuration.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
Expand Down
2 changes: 1 addition & 1 deletion clients/src/APIs/DPoPApi/DPoP/DPoPJwtBearerEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Microsoft.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using static IdentityModel.OidcConstants;
using static Duende.IdentityModel.OidcConstants;

namespace DPoPApi;

Expand Down
2 changes: 1 addition & 1 deletion clients/src/ConsoleCode/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Clients;
using Duende.IdentityModel.Client;
using Duende.IdentityModel.OidcClient;
using IdentityModel.OidcClient;
using Serilog;
using System;
using System.Net.Http;
Expand Down
2 changes: 1 addition & 1 deletion clients/src/ConsoleCode/SystemBrowser.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Duende.IdentityModel.OidcClient.Browser;
using IdentityModel.OidcClient.Browser;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
Expand Down
17 changes: 15 additions & 2 deletions clients/src/ConsoleDcrClient/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,21 @@ static async Task RegisterClient()
Scope = "resource1.scope1 resource2.scope1 IdentityServerApi"
}
};
request.Document.Extensions.Add("client_id", "client");
request.Document.Extensions.Add("client_secret", "secret");

var json = JsonDocument.Parse(
"""
{
"client_id": "client",
"client_secret": "secret"
}
"""
);

var clientJson = json.RootElement.GetProperty("client_id");
var secretJson = json.RootElement.GetProperty("client_secret");

request.Document.Extensions!.Add("client_id", clientJson);
request.Document.Extensions.Add("client_secret", secretJson);


var serialized = JsonSerializer.Serialize(request.Document);
Expand Down
6 changes: 3 additions & 3 deletions clients/src/ConsoleResourceIndicators/Program.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using Clients;
using Duende.IdentityModel.OidcClient;
using IdentityModel.OidcClient;
using Serilog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Duende.IdentityModel;
using Duende.IdentityModel.Client;
using IdentityModel;
using IdentityModel.Client;

namespace ConsoleResourceIndicators
{
Expand Down
2 changes: 1 addition & 1 deletion clients/src/ConsoleResourceIndicators/SystemBrowser.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Duende.IdentityModel.OidcClient.Browser;
using IdentityModel.OidcClient.Browser;
using System;
using System.Diagnostics;
using System.Net;
Expand Down

0 comments on commit df25289

Please sign in to comment.