feat(AuthTokenKeys): Erstellt, um Parameter für Authentifizierungs-Tokens zu konfigurieren.
- AuthTokenKeys aus der Konfiguration in Program.cs lesen. - Upgrade von Core.Abstractions auf 3.5
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.4" />
|
||||
<PackageReference Include="Scalar.AspNetCore" Version="2.2.1" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="8.1.1" />
|
||||
<PackageReference Include="DigitalData.Core.Abstractions" Version="3.4.4" />
|
||||
<PackageReference Include="DigitalData.Core.Abstractions" Version="3.5.0" />
|
||||
<PackageReference Include="DigitalData.Core.Application" Version="3.2.1" />
|
||||
<PackageReference Include="DigitalData.Core.DTO" Version="2.0.1" />
|
||||
<PackageReference Include="DigitalData.EmailProfilerDispatcher.Abstraction" Version="3.0.0" />
|
||||
|
||||
28
EnvelopeGenerator.GeneratorAPI/Models/AuthTokenKeys.cs
Normal file
28
EnvelopeGenerator.GeneratorAPI/Models/AuthTokenKeys.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
namespace EnvelopeGenerator.GeneratorAPI.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the keys and default values used for authentication token handling
|
||||
/// within the Envelope Generator API.
|
||||
/// </summary>
|
||||
public class AuthTokenKeys
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the name of the cookie used to store the authentication token.
|
||||
/// </summary>
|
||||
public string Cookie { get; init; } = "AuthToken";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the query string parameter used to pass the authentication token.
|
||||
/// </summary>
|
||||
public string QueryString { get; init; } = "AuthToken";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the expected issuer value for the authentication token.
|
||||
/// </summary>
|
||||
public string Issuer { get; init; } = "auth.digitaldata.works";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the expected audience value for the authentication token.
|
||||
/// </summary>
|
||||
public string Audience { get; init; } = "sign-flow-gen.digitaldata.works";
|
||||
}
|
||||
@@ -11,6 +11,7 @@ using DigitalData.UserManager.DependencyInjection;
|
||||
using EnvelopeGenerator.Application;
|
||||
using DigitalData.Auth.Client;
|
||||
using DigitalData.Core.Abstractions;
|
||||
using EnvelopeGenerator.GeneratorAPI.Models;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
@@ -90,6 +91,8 @@ builder.Services.AddDbContext<EGDbContext>(options => options.UseSqlServer(connS
|
||||
|
||||
builder.Services.AddAuthHubClient(config.GetSection("AuthClientParams"));
|
||||
|
||||
var authTokenKeys = config.GetOrDefault<AuthTokenKeys>();
|
||||
|
||||
// Authentication
|
||||
builder.Services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
|
||||
.AddCookie(options =>
|
||||
|
||||
@@ -30,5 +30,11 @@
|
||||
}
|
||||
],
|
||||
"RetryDelay": "00:00:05"
|
||||
},
|
||||
"AuthTokenKeys": {
|
||||
"Cookie": "AuthToken",
|
||||
"QueryString": "AuthToken",
|
||||
"Issuer": "auth.digitaldata.works",
|
||||
"Audience": "work-flow.digitaldata.works"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user