Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions IdentityServer/v7/Apis/SimpleApi/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

var builder = WebApplication.CreateBuilder(args);

builder.AddServiceDefaults();

builder.Services.AddSerilog();

builder.Services.AddControllers();
Expand All @@ -40,6 +42,8 @@

var app = builder.Build();

app.MapDefaultEndpoints();

app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
Expand Down
6 changes: 5 additions & 1 deletion IdentityServer/v7/Apis/SimpleApi/SimpleApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.5" />
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
<PackageReference Include="Serilog.AspNetCore" Version="10.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Aspire.ServiceDefaults\Aspire.ServiceDefaults.csproj" />
</ItemGroup>

<!-- Constants and helpers -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App"/>

<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="10.1.0"/>
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="10.1.0"/>
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.14.0"/>
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.14.0"/>
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.14.0"/>
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.14.0"/>
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.14.0"/>
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="10.4.0" />
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="10.4.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.15.1" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.15.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.15.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.15.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.15.0" />
</ItemGroup>

</Project>
13 changes: 0 additions & 13 deletions IdentityServer/v7/UserInteraction/Ciba/Api/Api.csproj

This file was deleted.

10 changes: 0 additions & 10 deletions IdentityServer/v7/UserInteraction/Ciba/Api/Constants.cs

This file was deleted.

27 changes: 0 additions & 27 deletions IdentityServer/v7/UserInteraction/Ciba/Api/IdentityController.cs

This file was deleted.

39 changes: 0 additions & 39 deletions IdentityServer/v7/UserInteraction/Ciba/Api/Program.cs

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Duende.IdentityModel" Version="7.1.0" />
<PackageReference Include="Duende.IdentityModel" Version="8.1.0" />
</ItemGroup>

</Project>
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var builder = DistributedApplication.CreateBuilder(args);

var idsvr = builder.AddProject<Projects.IdentityServerHost>("identityserverhost");

var api = builder.AddProject<Projects.SimpleApi>("simpleapi");

builder.AddProject<Projects.Client>("client")
.WaitFor(idsvr)
.WaitFor(api);

builder.Build().Run();
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Aspire.AppHost.Sdk/13.2.1">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<UserSecretsId>289847f7-34b8-436c-af32-3bf4c68e266f</UserSecretsId>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\Apis\SimpleApi\SimpleApi.csproj" />
<ProjectReference Include="..\Client\Client.csproj" />
<ProjectReference Include="..\IdentityServerHost\IdentityServerHost.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"Aspire.Hosting.Dcp": "Warning"
}
}
}
22 changes: 17 additions & 5 deletions IdentityServer/v7/UserInteraction/Ciba/IdentityServer.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@

<ItemGroup>
<PackageReference Include="Duende.IdentityServer" Version="7.4.7" />
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\Aspire.ServiceDefaults\Aspire.ServiceDefaults.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -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;
})
Expand All @@ -42,6 +30,8 @@

var app = builder.Build();

app.MapDefaultEndpoints();

if (app.Environment.IsDevelopment())
{
app.UseDeveloperExceptionPage();
Expand Down
10 changes: 10 additions & 0 deletions IdentityServer/v7/UserInteraction/Ciba/README.md
Original file line number Diff line number Diff line change
@@ -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").


4 changes: 4 additions & 0 deletions IdentityServer/v8/Apis/SimpleApi/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

var builder = WebApplication.CreateBuilder(args);

builder.AddServiceDefaults();

builder.Services.AddSerilog();

builder.Services.AddControllers();
Expand All @@ -40,6 +42,8 @@

var app = builder.Build();

app.MapDefaultEndpoints();

app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
Expand Down
6 changes: 5 additions & 1 deletion IdentityServer/v8/Apis/SimpleApi/SimpleApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.5" />
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
<PackageReference Include="Serilog.AspNetCore" Version="10.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Aspire.ServiceDefaults\Aspire.ServiceDefaults.csproj" />
</ItemGroup>

<!-- Constants and helpers -->
Expand Down
Loading
Loading