diff --git a/IdentityServer/v7/Apis/SimpleApi/Program.cs b/IdentityServer/v7/Apis/SimpleApi/Program.cs
index 17ca3b40..fd8a77d3 100755
--- a/IdentityServer/v7/Apis/SimpleApi/Program.cs
+++ b/IdentityServer/v7/Apis/SimpleApi/Program.cs
@@ -17,6 +17,8 @@
var builder = WebApplication.CreateBuilder(args);
+builder.AddServiceDefaults();
+
builder.Services.AddSerilog();
builder.Services.AddControllers();
@@ -40,6 +42,8 @@
var app = builder.Build();
+app.MapDefaultEndpoints();
+
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
diff --git a/IdentityServer/v7/Apis/SimpleApi/SimpleApi.csproj b/IdentityServer/v7/Apis/SimpleApi/SimpleApi.csproj
index 479d9eea..82f38c3d 100755
--- a/IdentityServer/v7/Apis/SimpleApi/SimpleApi.csproj
+++ b/IdentityServer/v7/Apis/SimpleApi/SimpleApi.csproj
@@ -7,7 +7,11 @@
-
+
+
+
+
+
diff --git a/IdentityServer/v7/Aspire.ServiceDefaults/Aspire.ServiceDefaults.csproj b/IdentityServer/v7/Aspire.ServiceDefaults/Aspire.ServiceDefaults.csproj
index 938db207..b02c9463 100644
--- a/IdentityServer/v7/Aspire.ServiceDefaults/Aspire.ServiceDefaults.csproj
+++ b/IdentityServer/v7/Aspire.ServiceDefaults/Aspire.ServiceDefaults.csproj
@@ -10,13 +10,13 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/IdentityServer/v7/UserInteraction/Ciba/Api/Api.csproj b/IdentityServer/v7/UserInteraction/Ciba/Api/Api.csproj
deleted file mode 100644
index c0cdf4ee..00000000
--- a/IdentityServer/v7/UserInteraction/Ciba/Api/Api.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- net10.0
- enable
-
-
-
-
-
-
-
-
diff --git a/IdentityServer/v7/UserInteraction/Ciba/Api/Constants.cs b/IdentityServer/v7/UserInteraction/Ciba/Api/Constants.cs
deleted file mode 100644
index e549d98a..00000000
--- a/IdentityServer/v7/UserInteraction/Ciba/Api/Constants.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright (c) Duende Software. All rights reserved.
-// Licensed under the MIT License. See LICENSE in the project root for license information.
-
-namespace Api;
-
-public class Constants
-{
- public const string Authority = "https://localhost:5001";
- public const string SampleApi = "https://localhost:5005/";
-}
diff --git a/IdentityServer/v7/UserInteraction/Ciba/Api/IdentityController.cs b/IdentityServer/v7/UserInteraction/Ciba/Api/IdentityController.cs
deleted file mode 100644
index 21b2e6f9..00000000
--- a/IdentityServer/v7/UserInteraction/Ciba/Api/IdentityController.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (c) Duende Software. All rights reserved.
-// Licensed under the MIT License. See LICENSE in the project root for license information.
-
-using Microsoft.AspNetCore.Mvc;
-
-namespace Api;
-
-[Route("identity")]
-public class IdentityController : ControllerBase
-{
- private readonly ILogger _logger;
-
- public IdentityController(ILogger logger)
- {
- _logger = logger;
- }
-
- // this action simply echoes the claims back to the client
- [HttpGet]
- public ActionResult Get()
- {
- var claims = User.Claims.Select(c => new { c.Type, c.Value });
- _logger.LogInformation("claims: {claims}", claims);
-
- return new JsonResult(claims);
- }
-}
diff --git a/IdentityServer/v7/UserInteraction/Ciba/Api/Program.cs b/IdentityServer/v7/UserInteraction/Ciba/Api/Program.cs
deleted file mode 100644
index b29acd3a..00000000
--- a/IdentityServer/v7/UserInteraction/Ciba/Api/Program.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (c) Duende Software. All rights reserved.
-// Licensed under the MIT License. See LICENSE in the project root for license information.
-
-using Api;
-using Serilog;
-using Serilog.Sinks.SystemConsole.Themes;
-
-Console.Title = "API";
-
-Log.Logger = new LoggerConfiguration()
- .MinimumLevel.Information()
- .Enrich.FromLogContext()
- .WriteTo.Console(outputTemplate: "[{Timestamp:HH:mm:ss} {Level}] {SourceContext}{NewLine}{Message:lj}{NewLine}{Exception}{NewLine}", theme: AnsiConsoleTheme.Code)
- .CreateLogger();
-
-var builder = WebApplication.CreateBuilder(args);
-
-builder.Services.AddControllers();
-
-// this API will accept any access token from the authority
-builder.Services.AddAuthentication("token")
- .AddJwtBearer("token", options =>
- {
- options.Authority = Constants.Authority;
- options.TokenValidationParameters.ValidateAudience = false;
-
- options.TokenValidationParameters.ValidTypes = new[] { "at+jwt" };
- options.MapInboundClaims = false;
- });
-
-var app = builder.Build();
-
-app.UseRouting();
-app.UseAuthentication();
-app.UseAuthorization();
-
-app.MapControllers().RequireAuthorization();
-
-app.Run();
diff --git a/IdentityServer/v7/UserInteraction/Ciba/Api/Properties/launchSettings.json b/IdentityServer/v7/UserInteraction/Ciba/Api/Properties/launchSettings.json
deleted file mode 100644
index eedda964..00000000
--- a/IdentityServer/v7/UserInteraction/Ciba/Api/Properties/launchSettings.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "profiles": {
- "Api": {
- "commandName": "Project",
- "environmentVariables": {
- "ASPNETCORE_ENVIRONMENT": "Development"
- },
- "applicationUrl": "https://localhost:5002"
- }
- }
-}
\ No newline at end of file
diff --git a/IdentityServer/v7/UserInteraction/Ciba/Client/Client.csproj b/IdentityServer/v7/UserInteraction/Ciba/Client/Client.csproj
index b27f765a..5191c825 100644
--- a/IdentityServer/v7/UserInteraction/Ciba/Client/Client.csproj
+++ b/IdentityServer/v7/UserInteraction/Ciba/Client/Client.csproj
@@ -7,7 +7,7 @@
-
+
diff --git a/IdentityServer/v7/UserInteraction/Ciba/Client/TokenResponseExtensions.cs b/IdentityServer/v7/UserInteraction/Ciba/Client/TokenResponseExtensions.cs
index dae78a5d..86334e35 100644
--- a/IdentityServer/v7/UserInteraction/Ciba/Client/TokenResponseExtensions.cs
+++ b/IdentityServer/v7/UserInteraction/Ciba/Client/TokenResponseExtensions.cs
@@ -1,6 +1,7 @@
// Copyright (c) Duende Software. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
+using System.Buffers.Text;
using System.Text;
using System.Text.Json;
using Duende.IdentityModel;
@@ -25,8 +26,8 @@ public static void Show(this TokenResponse response)
var header = parts[0];
var payload = parts[1];
- Console.WriteLine(PrettyPrintJson(Encoding.UTF8.GetString(Base64Url.Decode(header))));
- Console.WriteLine(PrettyPrintJson(Encoding.UTF8.GetString(Base64Url.Decode(payload))));
+ Console.WriteLine(PrettyPrintJson(Encoding.UTF8.GetString(Base64Url.DecodeFromChars(header))));
+ Console.WriteLine(PrettyPrintJson(Encoding.UTF8.GetString(Base64Url.DecodeFromChars(payload))));
}
}
else
diff --git a/IdentityServer/v7/UserInteraction/Ciba/IdentityServer.AppHost/AppHost.cs b/IdentityServer/v7/UserInteraction/Ciba/IdentityServer.AppHost/AppHost.cs
new file mode 100644
index 00000000..747c8772
--- /dev/null
+++ b/IdentityServer/v7/UserInteraction/Ciba/IdentityServer.AppHost/AppHost.cs
@@ -0,0 +1,11 @@
+var builder = DistributedApplication.CreateBuilder(args);
+
+var idsvr = builder.AddProject("identityserverhost");
+
+var api = builder.AddProject("simpleapi");
+
+builder.AddProject("client")
+ .WaitFor(idsvr)
+ .WaitFor(api);
+
+builder.Build().Run();
diff --git a/IdentityServer/v7/UserInteraction/Ciba/IdentityServer.AppHost/IdentityServer.AppHost.csproj b/IdentityServer/v7/UserInteraction/Ciba/IdentityServer.AppHost/IdentityServer.AppHost.csproj
new file mode 100644
index 00000000..0840125a
--- /dev/null
+++ b/IdentityServer/v7/UserInteraction/Ciba/IdentityServer.AppHost/IdentityServer.AppHost.csproj
@@ -0,0 +1,17 @@
+
+
+
+ Exe
+ net10.0
+ enable
+ enable
+ 289847f7-34b8-436c-af32-3bf4c68e266f
+
+
+
+
+
+
+
+
+
diff --git a/IdentityServer/v7/UserInteraction/Ciba/IdentityServer.AppHost/Properties/launchSettings.json b/IdentityServer/v7/UserInteraction/Ciba/IdentityServer.AppHost/Properties/launchSettings.json
new file mode 100644
index 00000000..a0d9737d
--- /dev/null
+++ b/IdentityServer/v7/UserInteraction/Ciba/IdentityServer.AppHost/Properties/launchSettings.json
@@ -0,0 +1,31 @@
+{
+ "$schema": "https://json.schemastore.org/launchsettings.json",
+ "profiles": {
+ "https": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ "applicationUrl": "https://localhost:17196;http://localhost:15048",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development",
+ "DOTNET_ENVIRONMENT": "Development",
+ "ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21100",
+ "ASPIRE_DASHBOARD_MCP_ENDPOINT_URL": "https://localhost:23036",
+ "ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22230"
+ }
+ },
+ "http": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ "applicationUrl": "http://localhost:15048",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development",
+ "DOTNET_ENVIRONMENT": "Development",
+ "ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19122",
+ "ASPIRE_DASHBOARD_MCP_ENDPOINT_URL": "http://localhost:18210",
+ "ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20059"
+ }
+ }
+ }
+}
diff --git a/IdentityServer/v7/UserInteraction/Ciba/IdentityServer.AppHost/appsettings.Development.json b/IdentityServer/v7/UserInteraction/Ciba/IdentityServer.AppHost/appsettings.Development.json
new file mode 100644
index 00000000..0c208ae9
--- /dev/null
+++ b/IdentityServer/v7/UserInteraction/Ciba/IdentityServer.AppHost/appsettings.Development.json
@@ -0,0 +1,8 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ }
+}
diff --git a/IdentityServer/v7/UserInteraction/Ciba/IdentityServer.AppHost/appsettings.json b/IdentityServer/v7/UserInteraction/Ciba/IdentityServer.AppHost/appsettings.json
new file mode 100644
index 00000000..31c092aa
--- /dev/null
+++ b/IdentityServer/v7/UserInteraction/Ciba/IdentityServer.AppHost/appsettings.json
@@ -0,0 +1,9 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning",
+ "Aspire.Hosting.Dcp": "Warning"
+ }
+ }
+}
diff --git a/IdentityServer/v7/UserInteraction/Ciba/IdentityServer.sln b/IdentityServer/v7/UserInteraction/Ciba/IdentityServer.sln
index 14a77a54..412e012d 100755
--- a/IdentityServer/v7/UserInteraction/Ciba/IdentityServer.sln
+++ b/IdentityServer/v7/UserInteraction/Ciba/IdentityServer.sln
@@ -6,7 +6,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IdentityServerHost", "Ident
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Client", "Client\Client.csproj", "{A31E166F-54C4-42E9-95E1-448B5BB8F3B3}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Api", "Api\Api.csproj", "{194ABC4A-1D22-4C99-B529-E99372976E1A}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleApi", "..\..\Apis\SimpleApi\SimpleApi.csproj", "{57164EAB-3ED9-4761-9797-997DF83D1038}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IdentityServer.AppHost", "IdentityServer.AppHost\IdentityServer.AppHost.csproj", "{30D57D51-6210-42FD-A464-91846D901E3C}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspire.ServiceDefaults", "..\..\Aspire.ServiceDefaults\Aspire.ServiceDefaults.csproj", "{4259ED99-4121-4E62-83C5-CC0699BC389A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -22,10 +26,18 @@ Global
{A31E166F-54C4-42E9-95E1-448B5BB8F3B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A31E166F-54C4-42E9-95E1-448B5BB8F3B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A31E166F-54C4-42E9-95E1-448B5BB8F3B3}.Release|Any CPU.Build.0 = Release|Any CPU
- {194ABC4A-1D22-4C99-B529-E99372976E1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {194ABC4A-1D22-4C99-B529-E99372976E1A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {194ABC4A-1D22-4C99-B529-E99372976E1A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {194ABC4A-1D22-4C99-B529-E99372976E1A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {57164EAB-3ED9-4761-9797-997DF83D1038}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {57164EAB-3ED9-4761-9797-997DF83D1038}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {57164EAB-3ED9-4761-9797-997DF83D1038}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {57164EAB-3ED9-4761-9797-997DF83D1038}.Release|Any CPU.Build.0 = Release|Any CPU
+ {30D57D51-6210-42FD-A464-91846D901E3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {30D57D51-6210-42FD-A464-91846D901E3C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {30D57D51-6210-42FD-A464-91846D901E3C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {30D57D51-6210-42FD-A464-91846D901E3C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {4259ED99-4121-4E62-83C5-CC0699BC389A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4259ED99-4121-4E62-83C5-CC0699BC389A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4259ED99-4121-4E62-83C5-CC0699BC389A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4259ED99-4121-4E62-83C5-CC0699BC389A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/IdentityServer/v7/UserInteraction/Ciba/IdentityServerHost/IdentityServerHost.csproj b/IdentityServer/v7/UserInteraction/Ciba/IdentityServerHost/IdentityServerHost.csproj
index f4d498ef..fd5e4ba2 100644
--- a/IdentityServer/v7/UserInteraction/Ciba/IdentityServerHost/IdentityServerHost.csproj
+++ b/IdentityServer/v7/UserInteraction/Ciba/IdentityServerHost/IdentityServerHost.csproj
@@ -7,7 +7,10 @@
-
+
+
+
+
diff --git a/IdentityServer/v7/UserInteraction/Ciba/IdentityServerHost/Program.cs b/IdentityServer/v7/UserInteraction/Ciba/IdentityServerHost/Program.cs
index 7082f9b2..9f0e869c 100644
--- a/IdentityServer/v7/UserInteraction/Ciba/IdentityServerHost/Program.cs
+++ b/IdentityServer/v7/UserInteraction/Ciba/IdentityServerHost/Program.cs
@@ -3,29 +3,17 @@
using IdentityServerHost;
using Microsoft.AspNetCore.DataProtection;
-using Serilog;
-using Serilog.Sinks.SystemConsole.Themes;
Console.Title = "IdentityServer";
-Log.Logger = new LoggerConfiguration()
- .MinimumLevel.Information()
- .Enrich.FromLogContext()
- .WriteTo.Console(outputTemplate: "[{Timestamp:HH:mm:ss} {Level}] {SourceContext}{NewLine}{Message:lj}{NewLine}{Exception}{NewLine}", theme: AnsiConsoleTheme.Code)
- .CreateLogger();
-
var builder = WebApplication.CreateBuilder(args);
-builder.Services.AddSerilog();
+
+builder.AddServiceDefaults();
builder.Services.AddRazorPages();
var idsvrBuilder = builder.Services.AddIdentityServer(options =>
{
- options.Events.RaiseErrorEvents = true;
- options.Events.RaiseInformationEvents = true;
- options.Events.RaiseFailureEvents = true;
- options.Events.RaiseSuccessEvents = true;
-
// see https://docs.duendesoftware.com/identityserver/fundamentals/resources/
options.EmitStaticAudienceClaim = true;
})
@@ -42,6 +30,8 @@
var app = builder.Build();
+app.MapDefaultEndpoints();
+
if (app.Environment.IsDevelopment())
{
app.UseDeveloperExceptionPage();
diff --git a/IdentityServer/v7/UserInteraction/Ciba/README.md b/IdentityServer/v7/UserInteraction/Ciba/README.md
new file mode 100644
index 00000000..e83a392b
--- /dev/null
+++ b/IdentityServer/v7/UserInteraction/Ciba/README.md
@@ -0,0 +1,10 @@
+**CIBA Sample**
+
+
+
+ This sample requires multiple projects to be run at once. That can easily be done by running the included Aspire AppHost. The Aspire dashboard will show the status of all running applications and show you the links to the running applications. Aspire will also collect the Open Telemetry data (logs, metrics, traces) and make it available on the dashboard.
+
+ For the included console application please look at the output of your IDE to see the results.
+Please read the instructions for this sample [here](https://docs.duendesoftware.com/identityserver/samples/ui/#client-initiated-backchannel-login-ciba "https://docs.duendesoftware.com/identityserver/samples/ui/#client-initiated-backchannel-login-ciba").
+
+
diff --git a/IdentityServer/v8/Apis/SimpleApi/Program.cs b/IdentityServer/v8/Apis/SimpleApi/Program.cs
index 17ca3b40..fd8a77d3 100755
--- a/IdentityServer/v8/Apis/SimpleApi/Program.cs
+++ b/IdentityServer/v8/Apis/SimpleApi/Program.cs
@@ -17,6 +17,8 @@
var builder = WebApplication.CreateBuilder(args);
+builder.AddServiceDefaults();
+
builder.Services.AddSerilog();
builder.Services.AddControllers();
@@ -40,6 +42,8 @@
var app = builder.Build();
+app.MapDefaultEndpoints();
+
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
diff --git a/IdentityServer/v8/Apis/SimpleApi/SimpleApi.csproj b/IdentityServer/v8/Apis/SimpleApi/SimpleApi.csproj
index 479d9eea..82f38c3d 100755
--- a/IdentityServer/v8/Apis/SimpleApi/SimpleApi.csproj
+++ b/IdentityServer/v8/Apis/SimpleApi/SimpleApi.csproj
@@ -7,7 +7,11 @@
-
+
+
+
+
+
diff --git a/IdentityServer/v8/Aspire.ServiceDefaults/Aspire.ServiceDefaults.csproj b/IdentityServer/v8/Aspire.ServiceDefaults/Aspire.ServiceDefaults.csproj
index 938db207..b02c9463 100644
--- a/IdentityServer/v8/Aspire.ServiceDefaults/Aspire.ServiceDefaults.csproj
+++ b/IdentityServer/v8/Aspire.ServiceDefaults/Aspire.ServiceDefaults.csproj
@@ -10,13 +10,13 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/IdentityServer/v8/UserInteraction/Ciba/Api/Api.csproj b/IdentityServer/v8/UserInteraction/Ciba/Api/Api.csproj
deleted file mode 100644
index c0cdf4ee..00000000
--- a/IdentityServer/v8/UserInteraction/Ciba/Api/Api.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- net10.0
- enable
-
-
-
-
-
-
-
-
diff --git a/IdentityServer/v8/UserInteraction/Ciba/Api/Constants.cs b/IdentityServer/v8/UserInteraction/Ciba/Api/Constants.cs
deleted file mode 100644
index e549d98a..00000000
--- a/IdentityServer/v8/UserInteraction/Ciba/Api/Constants.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright (c) Duende Software. All rights reserved.
-// Licensed under the MIT License. See LICENSE in the project root for license information.
-
-namespace Api;
-
-public class Constants
-{
- public const string Authority = "https://localhost:5001";
- public const string SampleApi = "https://localhost:5005/";
-}
diff --git a/IdentityServer/v8/UserInteraction/Ciba/Api/IdentityController.cs b/IdentityServer/v8/UserInteraction/Ciba/Api/IdentityController.cs
deleted file mode 100644
index 21b2e6f9..00000000
--- a/IdentityServer/v8/UserInteraction/Ciba/Api/IdentityController.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (c) Duende Software. All rights reserved.
-// Licensed under the MIT License. See LICENSE in the project root for license information.
-
-using Microsoft.AspNetCore.Mvc;
-
-namespace Api;
-
-[Route("identity")]
-public class IdentityController : ControllerBase
-{
- private readonly ILogger _logger;
-
- public IdentityController(ILogger logger)
- {
- _logger = logger;
- }
-
- // this action simply echoes the claims back to the client
- [HttpGet]
- public ActionResult Get()
- {
- var claims = User.Claims.Select(c => new { c.Type, c.Value });
- _logger.LogInformation("claims: {claims}", claims);
-
- return new JsonResult(claims);
- }
-}
diff --git a/IdentityServer/v8/UserInteraction/Ciba/Api/Program.cs b/IdentityServer/v8/UserInteraction/Ciba/Api/Program.cs
deleted file mode 100644
index b29acd3a..00000000
--- a/IdentityServer/v8/UserInteraction/Ciba/Api/Program.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (c) Duende Software. All rights reserved.
-// Licensed under the MIT License. See LICENSE in the project root for license information.
-
-using Api;
-using Serilog;
-using Serilog.Sinks.SystemConsole.Themes;
-
-Console.Title = "API";
-
-Log.Logger = new LoggerConfiguration()
- .MinimumLevel.Information()
- .Enrich.FromLogContext()
- .WriteTo.Console(outputTemplate: "[{Timestamp:HH:mm:ss} {Level}] {SourceContext}{NewLine}{Message:lj}{NewLine}{Exception}{NewLine}", theme: AnsiConsoleTheme.Code)
- .CreateLogger();
-
-var builder = WebApplication.CreateBuilder(args);
-
-builder.Services.AddControllers();
-
-// this API will accept any access token from the authority
-builder.Services.AddAuthentication("token")
- .AddJwtBearer("token", options =>
- {
- options.Authority = Constants.Authority;
- options.TokenValidationParameters.ValidateAudience = false;
-
- options.TokenValidationParameters.ValidTypes = new[] { "at+jwt" };
- options.MapInboundClaims = false;
- });
-
-var app = builder.Build();
-
-app.UseRouting();
-app.UseAuthentication();
-app.UseAuthorization();
-
-app.MapControllers().RequireAuthorization();
-
-app.Run();
diff --git a/IdentityServer/v8/UserInteraction/Ciba/Api/Properties/launchSettings.json b/IdentityServer/v8/UserInteraction/Ciba/Api/Properties/launchSettings.json
deleted file mode 100644
index eedda964..00000000
--- a/IdentityServer/v8/UserInteraction/Ciba/Api/Properties/launchSettings.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "profiles": {
- "Api": {
- "commandName": "Project",
- "environmentVariables": {
- "ASPNETCORE_ENVIRONMENT": "Development"
- },
- "applicationUrl": "https://localhost:5002"
- }
- }
-}
\ No newline at end of file
diff --git a/IdentityServer/v8/UserInteraction/Ciba/Client/Client.csproj b/IdentityServer/v8/UserInteraction/Ciba/Client/Client.csproj
index b27f765a..5191c825 100644
--- a/IdentityServer/v8/UserInteraction/Ciba/Client/Client.csproj
+++ b/IdentityServer/v8/UserInteraction/Ciba/Client/Client.csproj
@@ -7,7 +7,7 @@
-
+
diff --git a/IdentityServer/v8/UserInteraction/Ciba/Client/TokenResponseExtensions.cs b/IdentityServer/v8/UserInteraction/Ciba/Client/TokenResponseExtensions.cs
index dae78a5d..86334e35 100644
--- a/IdentityServer/v8/UserInteraction/Ciba/Client/TokenResponseExtensions.cs
+++ b/IdentityServer/v8/UserInteraction/Ciba/Client/TokenResponseExtensions.cs
@@ -1,6 +1,7 @@
// Copyright (c) Duende Software. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
+using System.Buffers.Text;
using System.Text;
using System.Text.Json;
using Duende.IdentityModel;
@@ -25,8 +26,8 @@ public static void Show(this TokenResponse response)
var header = parts[0];
var payload = parts[1];
- Console.WriteLine(PrettyPrintJson(Encoding.UTF8.GetString(Base64Url.Decode(header))));
- Console.WriteLine(PrettyPrintJson(Encoding.UTF8.GetString(Base64Url.Decode(payload))));
+ Console.WriteLine(PrettyPrintJson(Encoding.UTF8.GetString(Base64Url.DecodeFromChars(header))));
+ Console.WriteLine(PrettyPrintJson(Encoding.UTF8.GetString(Base64Url.DecodeFromChars(payload))));
}
}
else
diff --git a/IdentityServer/v8/UserInteraction/Ciba/IdentityServer.AppHost/AppHost.cs b/IdentityServer/v8/UserInteraction/Ciba/IdentityServer.AppHost/AppHost.cs
new file mode 100644
index 00000000..747c8772
--- /dev/null
+++ b/IdentityServer/v8/UserInteraction/Ciba/IdentityServer.AppHost/AppHost.cs
@@ -0,0 +1,11 @@
+var builder = DistributedApplication.CreateBuilder(args);
+
+var idsvr = builder.AddProject("identityserverhost");
+
+var api = builder.AddProject("simpleapi");
+
+builder.AddProject("client")
+ .WaitFor(idsvr)
+ .WaitFor(api);
+
+builder.Build().Run();
diff --git a/IdentityServer/v8/UserInteraction/Ciba/IdentityServer.AppHost/IdentityServer.AppHost.csproj b/IdentityServer/v8/UserInteraction/Ciba/IdentityServer.AppHost/IdentityServer.AppHost.csproj
new file mode 100644
index 00000000..f40964df
--- /dev/null
+++ b/IdentityServer/v8/UserInteraction/Ciba/IdentityServer.AppHost/IdentityServer.AppHost.csproj
@@ -0,0 +1,17 @@
+
+
+
+ Exe
+ net10.0
+ enable
+ enable
+ be144bbd-1d93-409b-91d6-62f973b4a627
+
+
+
+
+
+
+
+
+
diff --git a/IdentityServer/v8/UserInteraction/Ciba/IdentityServer.AppHost/Properties/launchSettings.json b/IdentityServer/v8/UserInteraction/Ciba/IdentityServer.AppHost/Properties/launchSettings.json
new file mode 100644
index 00000000..ef8f5eec
--- /dev/null
+++ b/IdentityServer/v8/UserInteraction/Ciba/IdentityServer.AppHost/Properties/launchSettings.json
@@ -0,0 +1,31 @@
+{
+ "$schema": "https://json.schemastore.org/launchsettings.json",
+ "profiles": {
+ "https": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ "applicationUrl": "https://localhost:17197;http://localhost:15148",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development",
+ "DOTNET_ENVIRONMENT": "Development",
+ "ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21120",
+ "ASPIRE_DASHBOARD_MCP_ENDPOINT_URL": "https://localhost:23015",
+ "ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22043"
+ }
+ },
+ "http": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ "applicationUrl": "http://localhost:15148",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development",
+ "DOTNET_ENVIRONMENT": "Development",
+ "ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19107",
+ "ASPIRE_DASHBOARD_MCP_ENDPOINT_URL": "http://localhost:18254",
+ "ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20078"
+ }
+ }
+ }
+}
diff --git a/IdentityServer/v8/UserInteraction/Ciba/IdentityServer.AppHost/appsettings.Development.json b/IdentityServer/v8/UserInteraction/Ciba/IdentityServer.AppHost/appsettings.Development.json
new file mode 100644
index 00000000..0c208ae9
--- /dev/null
+++ b/IdentityServer/v8/UserInteraction/Ciba/IdentityServer.AppHost/appsettings.Development.json
@@ -0,0 +1,8 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ }
+}
diff --git a/IdentityServer/v8/UserInteraction/Ciba/IdentityServer.AppHost/appsettings.json b/IdentityServer/v8/UserInteraction/Ciba/IdentityServer.AppHost/appsettings.json
new file mode 100644
index 00000000..31c092aa
--- /dev/null
+++ b/IdentityServer/v8/UserInteraction/Ciba/IdentityServer.AppHost/appsettings.json
@@ -0,0 +1,9 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning",
+ "Aspire.Hosting.Dcp": "Warning"
+ }
+ }
+}
diff --git a/IdentityServer/v8/UserInteraction/Ciba/IdentityServer.sln b/IdentityServer/v8/UserInteraction/Ciba/IdentityServer.sln
index 14a77a54..b5b4edbd 100755
--- a/IdentityServer/v8/UserInteraction/Ciba/IdentityServer.sln
+++ b/IdentityServer/v8/UserInteraction/Ciba/IdentityServer.sln
@@ -6,7 +6,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IdentityServerHost", "Ident
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Client", "Client\Client.csproj", "{A31E166F-54C4-42E9-95E1-448B5BB8F3B3}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Api", "Api\Api.csproj", "{194ABC4A-1D22-4C99-B529-E99372976E1A}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleApi", "..\..\Apis\SimpleApi\SimpleApi.csproj", "{C19D2155-5CEA-4C84-B179-BF2AA8B34CEC}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IdentityServer.AppHost", "IdentityServer.AppHost\IdentityServer.AppHost.csproj", "{6B3F90E4-4884-46FE-A31A-1CA6F9F8AC3D}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspire.ServiceDefaults", "..\..\Aspire.ServiceDefaults\Aspire.ServiceDefaults.csproj", "{9F81F4DE-4D15-4280-9D8A-1FE8D4D6578D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -22,10 +26,18 @@ Global
{A31E166F-54C4-42E9-95E1-448B5BB8F3B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A31E166F-54C4-42E9-95E1-448B5BB8F3B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A31E166F-54C4-42E9-95E1-448B5BB8F3B3}.Release|Any CPU.Build.0 = Release|Any CPU
- {194ABC4A-1D22-4C99-B529-E99372976E1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {194ABC4A-1D22-4C99-B529-E99372976E1A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {194ABC4A-1D22-4C99-B529-E99372976E1A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {194ABC4A-1D22-4C99-B529-E99372976E1A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C19D2155-5CEA-4C84-B179-BF2AA8B34CEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C19D2155-5CEA-4C84-B179-BF2AA8B34CEC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C19D2155-5CEA-4C84-B179-BF2AA8B34CEC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C19D2155-5CEA-4C84-B179-BF2AA8B34CEC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {6B3F90E4-4884-46FE-A31A-1CA6F9F8AC3D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {6B3F90E4-4884-46FE-A31A-1CA6F9F8AC3D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {6B3F90E4-4884-46FE-A31A-1CA6F9F8AC3D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {6B3F90E4-4884-46FE-A31A-1CA6F9F8AC3D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9F81F4DE-4D15-4280-9D8A-1FE8D4D6578D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9F81F4DE-4D15-4280-9D8A-1FE8D4D6578D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9F81F4DE-4D15-4280-9D8A-1FE8D4D6578D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9F81F4DE-4D15-4280-9D8A-1FE8D4D6578D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/IdentityServer/v8/UserInteraction/Ciba/IdentityServerHost/IdentityServerHost.csproj b/IdentityServer/v8/UserInteraction/Ciba/IdentityServerHost/IdentityServerHost.csproj
index 2143ce9b..6a12afdc 100644
--- a/IdentityServer/v8/UserInteraction/Ciba/IdentityServerHost/IdentityServerHost.csproj
+++ b/IdentityServer/v8/UserInteraction/Ciba/IdentityServerHost/IdentityServerHost.csproj
@@ -7,7 +7,10 @@
-
+
+
+
+
diff --git a/IdentityServer/v8/UserInteraction/Ciba/IdentityServerHost/Program.cs b/IdentityServer/v8/UserInteraction/Ciba/IdentityServerHost/Program.cs
index 7082f9b2..98af2ef5 100644
--- a/IdentityServer/v8/UserInteraction/Ciba/IdentityServerHost/Program.cs
+++ b/IdentityServer/v8/UserInteraction/Ciba/IdentityServerHost/Program.cs
@@ -3,29 +3,17 @@
using IdentityServerHost;
using Microsoft.AspNetCore.DataProtection;
-using Serilog;
-using Serilog.Sinks.SystemConsole.Themes;
Console.Title = "IdentityServer";
-Log.Logger = new LoggerConfiguration()
- .MinimumLevel.Information()
- .Enrich.FromLogContext()
- .WriteTo.Console(outputTemplate: "[{Timestamp:HH:mm:ss} {Level}] {SourceContext}{NewLine}{Message:lj}{NewLine}{Exception}{NewLine}", theme: AnsiConsoleTheme.Code)
- .CreateLogger();
-
var builder = WebApplication.CreateBuilder(args);
-builder.Services.AddSerilog();
+
+builder.AddServiceDefaults();
builder.Services.AddRazorPages();
var idsvrBuilder = builder.Services.AddIdentityServer(options =>
{
- options.Events.RaiseErrorEvents = true;
- options.Events.RaiseInformationEvents = true;
- options.Events.RaiseFailureEvents = true;
- options.Events.RaiseSuccessEvents = true;
-
// see https://docs.duendesoftware.com/identityserver/fundamentals/resources/
options.EmitStaticAudienceClaim = true;
})
@@ -42,6 +30,8 @@
var app = builder.Build();
+app.MapDefaultEndpoints();
+
if (app.Environment.IsDevelopment())
{
app.UseDeveloperExceptionPage();
@@ -52,6 +42,7 @@
app.UseRouting();
app.UseIdentityServer();
app.UseAuthorization();
+
app.MapRazorPages();
app.Run();
diff --git a/IdentityServer/v8/UserInteraction/Ciba/README.md b/IdentityServer/v8/UserInteraction/Ciba/README.md
new file mode 100644
index 00000000..e83a392b
--- /dev/null
+++ b/IdentityServer/v8/UserInteraction/Ciba/README.md
@@ -0,0 +1,10 @@
+**CIBA Sample**
+
+
+
+ This sample requires multiple projects to be run at once. That can easily be done by running the included Aspire AppHost. The Aspire dashboard will show the status of all running applications and show you the links to the running applications. Aspire will also collect the Open Telemetry data (logs, metrics, traces) and make it available on the dashboard.
+
+ For the included console application please look at the output of your IDE to see the results.
+Please read the instructions for this sample [here](https://docs.duendesoftware.com/identityserver/samples/ui/#client-initiated-backchannel-login-ciba "https://docs.duendesoftware.com/identityserver/samples/ui/#client-initiated-backchannel-login-ciba").
+
+
diff --git a/samples.slnx b/samples.slnx
index 04f07c28..72d01f24 100644
--- a/samples.slnx
+++ b/samples.slnx
@@ -299,7 +299,6 @@
-
@@ -503,7 +502,6 @@
-