diff --git a/IdentityServer/v7/Basics/MvcJarJwt/MvcJarJwt.AppHost/MvcJarJwt.AppHost.csproj b/IdentityServer/v7/Basics/MvcJarJwt/MvcJarJwt.AppHost/MvcJarJwt.AppHost.csproj new file mode 100644 index 00000000..9d1cdbb7 --- /dev/null +++ b/IdentityServer/v7/Basics/MvcJarJwt/MvcJarJwt.AppHost/MvcJarJwt.AppHost.csproj @@ -0,0 +1,20 @@ + + + + Exe + net10.0 + enable + enable + + + + + + + + + + + + + diff --git a/IdentityServer/v7/Basics/MvcJarJwt/MvcJarJwt.AppHost/Program.cs b/IdentityServer/v7/Basics/MvcJarJwt/MvcJarJwt.AppHost/Program.cs new file mode 100644 index 00000000..16c47d96 --- /dev/null +++ b/IdentityServer/v7/Basics/MvcJarJwt/MvcJarJwt.AppHost/Program.cs @@ -0,0 +1,11 @@ +var builder = DistributedApplication.CreateBuilder(args); + +var idp = builder.AddProject("identityserverhost"); + +var api = builder.AddProject("simple-api"); + +builder.AddProject("client") + .WaitFor(idp) + .WaitFor(api); + +builder.Build().Run(); diff --git a/IdentityServer/v7/Basics/MvcJarJwt/MvcJarJwt.AppHost/Properties/launchSettings.json b/IdentityServer/v7/Basics/MvcJarJwt/MvcJarJwt.AppHost/Properties/launchSettings.json new file mode 100644 index 00000000..878381cd --- /dev/null +++ b/IdentityServer/v7/Basics/MvcJarJwt/MvcJarJwt.AppHost/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "http://localhost:15237", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development", + "DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:21137", + "DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:22137" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:17237;http://localhost:15237", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development", + "DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21137", + "DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22137" + } + } + } +} diff --git a/IdentityServer/v7/Basics/MvcJarJwt/MvcJarJwt.AppHost/appsettings.development.json b/IdentityServer/v7/Basics/MvcJarJwt/MvcJarJwt.AppHost/appsettings.development.json new file mode 100644 index 00000000..c06aa74a --- /dev/null +++ b/IdentityServer/v7/Basics/MvcJarJwt/MvcJarJwt.AppHost/appsettings.development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning", + "Aspire.Hosting.DistributedApplication": "Information" + } + } +} diff --git a/IdentityServer/v7/Basics/MvcJarJwt/MvcJarJwt.AppHost/appsettings.json b/IdentityServer/v7/Basics/MvcJarJwt/MvcJarJwt.AppHost/appsettings.json new file mode 100644 index 00000000..c06aa74a --- /dev/null +++ b/IdentityServer/v7/Basics/MvcJarJwt/MvcJarJwt.AppHost/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning", + "Aspire.Hosting.DistributedApplication": "Information" + } + } +} diff --git a/IdentityServer/v7/Basics/MvcJarJwt/MvcJarJwt.sln b/IdentityServer/v7/Basics/MvcJarJwt/MvcJarJwt.sln index fb2723fa..a9942a54 100755 --- a/IdentityServer/v7/Basics/MvcJarJwt/MvcJarJwt.sln +++ b/IdentityServer/v7/Basics/MvcJarJwt/MvcJarJwt.sln @@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleApi", "..\..\Apis\Sim EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IdentityServerHost", "..\..\IdentityServerHost\src\IdentityServerHost.csproj", "{7BCF45DF-B314-48E0-86A1-90886840804A}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvcJarJwt.AppHost", "MvcJarJwt.AppHost\MvcJarJwt.AppHost.csproj", "{B3C2D4E5-F6A7-4B8C-9D0E-F1A2B3C4D5E6}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -70,6 +72,18 @@ Global {7BCF45DF-B314-48E0-86A1-90886840804A}.Release|x64.Build.0 = Release|Any CPU {7BCF45DF-B314-48E0-86A1-90886840804A}.Release|x86.ActiveCfg = Release|Any CPU {7BCF45DF-B314-48E0-86A1-90886840804A}.Release|x86.Build.0 = Release|Any CPU + {B3C2D4E5-F6A7-4B8C-9D0E-F1A2B3C4D5E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B3C2D4E5-F6A7-4B8C-9D0E-F1A2B3C4D5E6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B3C2D4E5-F6A7-4B8C-9D0E-F1A2B3C4D5E6}.Debug|x64.ActiveCfg = Debug|Any CPU + {B3C2D4E5-F6A7-4B8C-9D0E-F1A2B3C4D5E6}.Debug|x64.Build.0 = Debug|Any CPU + {B3C2D4E5-F6A7-4B8C-9D0E-F1A2B3C4D5E6}.Debug|x86.ActiveCfg = Debug|Any CPU + {B3C2D4E5-F6A7-4B8C-9D0E-F1A2B3C4D5E6}.Debug|x86.Build.0 = Debug|Any CPU + {B3C2D4E5-F6A7-4B8C-9D0E-F1A2B3C4D5E6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B3C2D4E5-F6A7-4B8C-9D0E-F1A2B3C4D5E6}.Release|Any CPU.Build.0 = Release|Any CPU + {B3C2D4E5-F6A7-4B8C-9D0E-F1A2B3C4D5E6}.Release|x64.ActiveCfg = Release|Any CPU + {B3C2D4E5-F6A7-4B8C-9D0E-F1A2B3C4D5E6}.Release|x64.Build.0 = Release|Any CPU + {B3C2D4E5-F6A7-4B8C-9D0E-F1A2B3C4D5E6}.Release|x86.ActiveCfg = Release|Any CPU + {B3C2D4E5-F6A7-4B8C-9D0E-F1A2B3C4D5E6}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution EndGlobalSection diff --git a/IdentityServer/v7/Basics/MvcJarJwt/src/Client.csproj b/IdentityServer/v7/Basics/MvcJarJwt/src/Client.csproj index ad90312d..d0250387 100755 --- a/IdentityServer/v7/Basics/MvcJarJwt/src/Client.csproj +++ b/IdentityServer/v7/Basics/MvcJarJwt/src/Client.csproj @@ -9,6 +9,10 @@ + + + + diff --git a/IdentityServer/v7/Basics/MvcJarJwt/src/Program.cs b/IdentityServer/v7/Basics/MvcJarJwt/src/Program.cs index 73281abe..27420375 100755 --- a/IdentityServer/v7/Basics/MvcJarJwt/src/Program.cs +++ b/IdentityServer/v7/Basics/MvcJarJwt/src/Program.cs @@ -11,10 +11,13 @@ using Microsoft.AspNetCore.Authentication.OpenIdConnect; using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; using Microsoft.IdentityModel.Tokens; var builder = WebApplication.CreateBuilder(args); +builder.AddServiceDefaults(); + JwtSecurityTokenHandler.DefaultMapInboundClaims = false; builder.Services.AddControllersWithViews(); @@ -97,6 +100,8 @@ var app = builder.Build(); +app.MapDefaultEndpoints(); + app.UseDeveloperExceptionPage(); app.UseStaticFiles(); diff --git a/IdentityServer/v8/Basics/MvcJarJwt/MvcJarJwt.AppHost/MvcJarJwt.AppHost.csproj b/IdentityServer/v8/Basics/MvcJarJwt/MvcJarJwt.AppHost/MvcJarJwt.AppHost.csproj new file mode 100644 index 00000000..9d1cdbb7 --- /dev/null +++ b/IdentityServer/v8/Basics/MvcJarJwt/MvcJarJwt.AppHost/MvcJarJwt.AppHost.csproj @@ -0,0 +1,20 @@ + + + + Exe + net10.0 + enable + enable + + + + + + + + + + + + + diff --git a/IdentityServer/v8/Basics/MvcJarJwt/MvcJarJwt.AppHost/Program.cs b/IdentityServer/v8/Basics/MvcJarJwt/MvcJarJwt.AppHost/Program.cs new file mode 100644 index 00000000..16c47d96 --- /dev/null +++ b/IdentityServer/v8/Basics/MvcJarJwt/MvcJarJwt.AppHost/Program.cs @@ -0,0 +1,11 @@ +var builder = DistributedApplication.CreateBuilder(args); + +var idp = builder.AddProject("identityserverhost"); + +var api = builder.AddProject("simple-api"); + +builder.AddProject("client") + .WaitFor(idp) + .WaitFor(api); + +builder.Build().Run(); diff --git a/IdentityServer/v8/Basics/MvcJarJwt/MvcJarJwt.AppHost/Properties/launchSettings.json b/IdentityServer/v8/Basics/MvcJarJwt/MvcJarJwt.AppHost/Properties/launchSettings.json new file mode 100644 index 00000000..79e7ad7e --- /dev/null +++ b/IdentityServer/v8/Basics/MvcJarJwt/MvcJarJwt.AppHost/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "http://localhost:15236", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development", + "DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:21136", + "DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:22136" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:17236;http://localhost:15236", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development", + "DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21136", + "DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22136" + } + } + } +} diff --git a/IdentityServer/v8/Basics/MvcJarJwt/MvcJarJwt.AppHost/appsettings.development.json b/IdentityServer/v8/Basics/MvcJarJwt/MvcJarJwt.AppHost/appsettings.development.json new file mode 100644 index 00000000..c06aa74a --- /dev/null +++ b/IdentityServer/v8/Basics/MvcJarJwt/MvcJarJwt.AppHost/appsettings.development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning", + "Aspire.Hosting.DistributedApplication": "Information" + } + } +} diff --git a/IdentityServer/v8/Basics/MvcJarJwt/MvcJarJwt.AppHost/appsettings.json b/IdentityServer/v8/Basics/MvcJarJwt/MvcJarJwt.AppHost/appsettings.json new file mode 100644 index 00000000..c06aa74a --- /dev/null +++ b/IdentityServer/v8/Basics/MvcJarJwt/MvcJarJwt.AppHost/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning", + "Aspire.Hosting.DistributedApplication": "Information" + } + } +} diff --git a/IdentityServer/v8/Basics/MvcJarJwt/MvcJarJwt.sln b/IdentityServer/v8/Basics/MvcJarJwt/MvcJarJwt.sln index fb2723fa..daa655bc 100755 --- a/IdentityServer/v8/Basics/MvcJarJwt/MvcJarJwt.sln +++ b/IdentityServer/v8/Basics/MvcJarJwt/MvcJarJwt.sln @@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleApi", "..\..\Apis\Sim EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IdentityServerHost", "..\..\IdentityServerHost\src\IdentityServerHost.csproj", "{7BCF45DF-B314-48E0-86A1-90886840804A}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvcJarJwt.AppHost", "MvcJarJwt.AppHost\MvcJarJwt.AppHost.csproj", "{A2B1C3D4-E5F6-4A7B-8C9D-E0F1A2B3C4D5}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -70,6 +72,18 @@ Global {7BCF45DF-B314-48E0-86A1-90886840804A}.Release|x64.Build.0 = Release|Any CPU {7BCF45DF-B314-48E0-86A1-90886840804A}.Release|x86.ActiveCfg = Release|Any CPU {7BCF45DF-B314-48E0-86A1-90886840804A}.Release|x86.Build.0 = Release|Any CPU + {A2B1C3D4-E5F6-4A7B-8C9D-E0F1A2B3C4D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A2B1C3D4-E5F6-4A7B-8C9D-E0F1A2B3C4D5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A2B1C3D4-E5F6-4A7B-8C9D-E0F1A2B3C4D5}.Debug|x64.ActiveCfg = Debug|Any CPU + {A2B1C3D4-E5F6-4A7B-8C9D-E0F1A2B3C4D5}.Debug|x64.Build.0 = Debug|Any CPU + {A2B1C3D4-E5F6-4A7B-8C9D-E0F1A2B3C4D5}.Debug|x86.ActiveCfg = Debug|Any CPU + {A2B1C3D4-E5F6-4A7B-8C9D-E0F1A2B3C4D5}.Debug|x86.Build.0 = Debug|Any CPU + {A2B1C3D4-E5F6-4A7B-8C9D-E0F1A2B3C4D5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A2B1C3D4-E5F6-4A7B-8C9D-E0F1A2B3C4D5}.Release|Any CPU.Build.0 = Release|Any CPU + {A2B1C3D4-E5F6-4A7B-8C9D-E0F1A2B3C4D5}.Release|x64.ActiveCfg = Release|Any CPU + {A2B1C3D4-E5F6-4A7B-8C9D-E0F1A2B3C4D5}.Release|x64.Build.0 = Release|Any CPU + {A2B1C3D4-E5F6-4A7B-8C9D-E0F1A2B3C4D5}.Release|x86.ActiveCfg = Release|Any CPU + {A2B1C3D4-E5F6-4A7B-8C9D-E0F1A2B3C4D5}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution EndGlobalSection diff --git a/IdentityServer/v8/Basics/MvcJarJwt/src/Client.csproj b/IdentityServer/v8/Basics/MvcJarJwt/src/Client.csproj index ad90312d..d0250387 100755 --- a/IdentityServer/v8/Basics/MvcJarJwt/src/Client.csproj +++ b/IdentityServer/v8/Basics/MvcJarJwt/src/Client.csproj @@ -9,6 +9,10 @@ + + + + diff --git a/IdentityServer/v8/Basics/MvcJarJwt/src/Program.cs b/IdentityServer/v8/Basics/MvcJarJwt/src/Program.cs index 73281abe..27420375 100755 --- a/IdentityServer/v8/Basics/MvcJarJwt/src/Program.cs +++ b/IdentityServer/v8/Basics/MvcJarJwt/src/Program.cs @@ -11,10 +11,13 @@ using Microsoft.AspNetCore.Authentication.OpenIdConnect; using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; using Microsoft.IdentityModel.Tokens; var builder = WebApplication.CreateBuilder(args); +builder.AddServiceDefaults(); + JwtSecurityTokenHandler.DefaultMapInboundClaims = false; builder.Services.AddControllersWithViews(); @@ -97,6 +100,8 @@ var app = builder.Build(); +app.MapDefaultEndpoints(); + app.UseDeveloperExceptionPage(); app.UseStaticFiles(); diff --git a/samples.slnx b/samples.slnx index 491beab4..107988ea 100644 --- a/samples.slnx +++ b/samples.slnx @@ -222,6 +222,7 @@ + @@ -449,6 +450,7 @@ +