From e28f4560d6bb38b7f84f0f6ec10cd15c97240e28 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Mon, 10 Mar 2025 09:48:10 +0100 Subject: [PATCH] Refactor: Inline AuthHubClient Optionen durch Konfigurationsabschnitt ersetzen --- WorkFlow.API/Program.cs | 5 +---- WorkFlow.API/WorkFlow.API.csproj | 2 +- WorkFlow.API/appsettings.json | 12 +++++++----- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/WorkFlow.API/Program.cs b/WorkFlow.API/Program.cs index c92b190..bfa128b 100644 --- a/WorkFlow.API/Program.cs +++ b/WorkFlow.API/Program.cs @@ -50,10 +50,7 @@ try var authPublicKey = config.GetSection("AuthPublicKey").Get() ?? throw new InvalidOperationException("The AuthPublicKey configuration is missing or invalid."); - builder.Services.AddAuthHubClient(config, opt => - { - opt.PublicKeys.Add(authPublicKey); - }); + builder.Services.AddAuthHubClient(config.GetSection("AuthClientParams")); builder.Services.AddControllers(); diff --git a/WorkFlow.API/WorkFlow.API.csproj b/WorkFlow.API/WorkFlow.API.csproj index a12de09..374d12d 100644 --- a/WorkFlow.API/WorkFlow.API.csproj +++ b/WorkFlow.API/WorkFlow.API.csproj @@ -12,7 +12,7 @@ - + diff --git a/WorkFlow.API/appsettings.json b/WorkFlow.API/appsettings.json index df43ba2..5a9244a 100644 --- a/WorkFlow.API/appsettings.json +++ b/WorkFlow.API/appsettings.json @@ -78,10 +78,12 @@ } }, "AuthClientParams": { - "Url": "https://localhost:7192" - }, - "AuthPublicKey": { - "Issuer": "auth.digitaldata.works", - "Audience": "work-flow.digitaldata.works" + "Url": "https://localhost:7192", + "PublicKeys": [ + { + "Issuer": "auth.digitaldata.works", + "Audience": "work-flow.digitaldata.works" + } + ] } } \ No newline at end of file