Add EnvelopeAuthService for SSR authentication
Introduced `EnvelopeAuthService` and `IEnvelopeAuthService` to handle server-side authentication for envelope receiver pages. - Registered `IEnvelopeAuthService` as a scoped service in `Program.cs`. - Implemented `EnvelopeAuthService` to validate user authentication and envelope key matching using `IHttpContextAccessor` and JWT claims. - Added methods to retrieve the authenticated envelope key and current user (`ClaimsPrincipal`). - Prioritized `NameIdentifier` claim for envelope key extraction, with fallback to `sub` claim. - Documented the service and interface with XML comments for clarity. This centralizes authentication logic, ensuring reusability and adherence to SSR best practices.
This commit is contained in:
@@ -319,6 +319,9 @@ try
|
||||
builder.Services.AddScoped<SignatureCacheService>();
|
||||
builder.Services.AddSingleton<AppVersionService>();
|
||||
|
||||
// SSR Authentication Service (for Envelope Receiver pages)
|
||||
builder.Services.AddScoped<EnvelopeGenerator.Server.Services.IEnvelopeAuthService, EnvelopeGenerator.Server.Services.EnvelopeAuthService>();
|
||||
|
||||
// DevExpress Server-Side Services (CRITICAL for DxPdfViewer)
|
||||
builder.Services.AddDevExpressBlazor();
|
||||
builder.Services.AddDevExpressServerSideBlazorPdfViewer();
|
||||
|
||||
Reference in New Issue
Block a user