diff --git a/EnvelopeGenerator.GeneratorAPI/EnvelopeGenerator.GeneratorAPI.csproj b/EnvelopeGenerator.GeneratorAPI/EnvelopeGenerator.GeneratorAPI.csproj index 95325e67..2b88fcca 100644 --- a/EnvelopeGenerator.GeneratorAPI/EnvelopeGenerator.GeneratorAPI.csproj +++ b/EnvelopeGenerator.GeneratorAPI/EnvelopeGenerator.GeneratorAPI.csproj @@ -19,7 +19,7 @@ - + diff --git a/EnvelopeGenerator.GeneratorAPI/Program.cs b/EnvelopeGenerator.GeneratorAPI/Program.cs index 77ee0bab..6ba72940 100644 --- a/EnvelopeGenerator.GeneratorAPI/Program.cs +++ b/EnvelopeGenerator.GeneratorAPI/Program.cs @@ -1,6 +1,5 @@ using DigitalData.Core.API; using DigitalData.Core.Application; -using DigitalData.UserManager.Application; using EnvelopeGenerator.Infrastructure; using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.AspNetCore.Localization; @@ -10,6 +9,7 @@ using Scalar.AspNetCore; using Microsoft.OpenApi.Models; using DigitalData.UserManager.DependencyInjection; using EnvelopeGenerator.Application; +using DigitalData.Auth.Client; var builder = WebApplication.CreateBuilder(args); @@ -85,6 +85,8 @@ builder.Services.AddOpenApi(); var connStr = config.GetConnectionString("Default") ?? throw new InvalidOperationException("There is no default connection string in appsettings.json."); builder.Services.AddDbContext(options => options.UseSqlServer(connStr)); +builder.Services.AddAuthHubClient(config.GetSection("AuthClientParams")); + // Authentication builder.Services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme) .AddCookie(options => diff --git a/EnvelopeGenerator.GeneratorAPI/appsettings.Development.json b/EnvelopeGenerator.GeneratorAPI/appsettings.Development.json index 0c208ae9..7525e080 100644 --- a/EnvelopeGenerator.GeneratorAPI/appsettings.Development.json +++ b/EnvelopeGenerator.GeneratorAPI/appsettings.Development.json @@ -4,5 +4,15 @@ "Default": "Information", "Microsoft.AspNetCore": "Warning" } + }, + "AuthClientParams": { + "Url": "https://localhost:7192/auth-hub", + "PublicKeys": [ + { + "Issuer": "auth.digitaldata.works", + "Audience": "sign-flow-gen.digitaldata.works" + } + ], + "RetryDelay": "00:00:05" } } diff --git a/EnvelopeGenerator.GeneratorAPI/appsettings.json b/EnvelopeGenerator.GeneratorAPI/appsettings.json index 734a3dcb..d7c6e9bd 100644 --- a/EnvelopeGenerator.GeneratorAPI/appsettings.json +++ b/EnvelopeGenerator.GeneratorAPI/appsettings.json @@ -20,5 +20,15 @@ "User": "(&(objectClass=user)(sAMAccountName=*))", "Group": "(&(objectClass=group)(samAccountName=*))" } + }, + "AuthClientParams": { + "Url": "https://localhost:7192/auth-hub", + "PublicKeys": [ + { + "Issuer": "auth.digitaldata.works", + "Audience": "sign-flow-gen.digitaldata.works" + } + ], + "RetryDelay": "00:00:05" } }