WIP: Add Keycloak jwt bearer

This commit is contained in:
2025-08-03 12:19:29 +02:00
parent 164aa79dae
commit c981b24c60
8 changed files with 71 additions and 18 deletions

View File

@@ -13,11 +13,13 @@
<ItemGroup>
<ProjectReference Include="..\PresentPortal.ApiService\PresentPortal.ApiService.csproj"/>
<ProjectReference Include="..\PresentPortal.Shared\PresentPortal.Shared.csproj" IsAspireProjectResource="false" />
<ProjectReference Include="..\PresentPortal.Web\PresentPortal.Web.csproj"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Aspire.Hosting.AppHost" />
<PackageReference Include="Aspire.Hosting.Keycloak" />
<PackageReference Include="Aspire.Hosting.Redis" />
</ItemGroup>

View File

@@ -1,8 +1,17 @@
using PresentPortal.Shared;
var builder = DistributedApplication.CreateBuilder(args);
var cache = builder.AddRedis("cache");
var apiService = builder.AddProject<Projects.PresentPortal_ApiService>("apiservice");
var keycloak = builder.AddKeycloak("keycloak", 8080)
.WithDataVolume()
.WithExternalHttpEndpoints()
.WithLifetime(ContainerLifetime.Persistent);
var apiService = builder.AddProject<Projects.PresentPortal_ApiService>(ServiceNames.Api)
.WithReference(keycloak)
.WaitFor(keycloak);
builder.AddProject<Projects.PresentPortal_Web>("webfrontend")
.WithExternalHttpEndpoints()