Commit Graph

103 Commits

Author SHA1 Message Date
2fed1baff5 Add JWT token support for EnvelopeReceiver entities
Enhanced the `AuthController` to support JWT token generation
for `EnvelopeReceiverSecretDto` entities. Added a new
dependency `IJwtSignatureHandler<EnvelopeReceiverSecretDto>`
and updated the constructor to inject it.

Refactored the `CreateTokenForEnvelopeReceiver` method:
- Added a `cookie` query parameter to control token delivery.
- Implemented consumer validation using `_consumerService`.
- Added token descriptor retrieval from `_keyPool`.
- Improved `AccessCode` validation for `EnvelopeReceiver`.
- Added logic to set tokens as cookies or return in the body.

Updated `using` directives to include required namespaces.
Improved error handling, readability, and flexibility in
token generation and delivery.
2026-05-29 08:47:54 +02:00
90d74282d8 Add envelope receiver token endpoint to AuthController
Refactor `AuthController` to include `IMediator` dependency and
introduce a new `CreateTokenForEnvelopeReceiver` API endpoint
to handle envelope receiver authentication.

- Updated `using` directives to remove unused namespaces and
  add required ones for new functionality.
- Added `ReceiverLogin` model to represent envelope receiver
  login credentials.
- Implemented `ReadEnvelopeReceiverSecretQuery` to validate
  access codes for envelope receivers.
- Cleaned up unused fields and dependencies in `AuthController`.
2026-05-29 00:21:36 +02:00
a7a386924e Update JwtBearer and EnvelopeGenerator packages
Added Microsoft.AspNetCore.Authentication.JwtBearer (8.0.17) to the test project.
Updated EnvelopeGenerator to version 1.2.0.3 in the API project.
Aligned JwtBearer version to 8.0.17 for the net8.0 target framework.
2026-05-29 00:21:10 +02:00
e55a6a3663 Add global exception handling middleware
Introduced `ExceptionHandlingMiddleware` to handle exceptions
globally, log errors, and return appropriate JSON responses.
Registered the middleware in `Program.cs` to ensure all requests
are processed through it. Added localization support in
`Program.cs` to enable localized error messages and other
features.
2026-05-29 00:20:55 +02:00
e80ad19c96 Add MediatR package to enable Mediator design pattern
The `MediatR` package (version 12.5.0) was added to the
`DigitalData.Auth.API.csproj` file. This introduces support
for the Mediator design pattern, which helps reduce coupling
between components and facilitates structured communication
via requests, commands, or queries.
2026-05-28 22:37:29 +02:00
d2d992b41e Add DbTriggerParams section to appsettings.json
Introduced a new `DbTriggerParams` configuration section in
`appsettings.json` to define database triggers for various
application components.

The section includes keys such as `Envelope`, `History`,
`EmailOut`, `EnvelopeReceiverReadOnly`, `Receiver`, and
`EmailTemplate`, each with corresponding arrays of trigger
names. This change enhances the application's ability to
manage database events in a structured and configurable way.
2026-05-28 22:30:28 +02:00
ff8d683040 Add EF Core SQL Server support to the project
Added `Microsoft.EntityFrameworkCore.SqlServer` package to the
`DigitalData.Auth.API.csproj` file to enable SQL Server as the
database provider. Updated `Program.cs` to include the
`Microsoft.EntityFrameworkCore` namespace for database interaction.
2026-05-28 22:26:48 +02:00
163916e330 Update dependencies and integrate EnvelopeGenerator
Updated `DigitalData.Auth.Tests.csproj` to include `Microsoft.EntityFrameworkCore` version `8.0.17`.

Refactored `AuthController.cs` to remove unused imports and update to the latest `DigitalData.Core.Abstraction.Application` namespaces.

Streamlined `DigitalData.Auth.API.csproj`:
- Changed target framework to `net8.0`.
- Upgraded `DigitalData.Core.Abstractions` to `4.3.0` and `DigitalData.Core.Application` to `3.4.0`.
- Added `EnvelopeGenerator` and `Microsoft.EntityFrameworkCore` dependencies.
- Removed outdated `UserManager` dependencies.

Enhanced `Program.cs`:
- Integrated `EnvelopeGenerator` services with database context and caching configuration.
- Removed `AddUserManager` service registration.
- Added SQL Server logging and error handling for `DbContext`.

These changes improve maintainability, adopt modern frameworks, and introduce new functionality with `EnvelopeGenerator`.
2026-05-28 22:26:31 +02:00
6bcc16cead Update project version to 1.3.0
Bump <Version>, <AssemblyVersion>, and <FileVersion> in DigitalData.Auth.API.csproj from 1.2.0 to 1.3.0.
2026-02-03 14:00:46 +01:00
a461cbaa71 Add CommonUserRoles section to appsettings.json
Added "CommonUserRoles" array with roles: Admin, UserManager, ContentManager, and Signatory to appsettings.json for improved role management configuration. No other changes made.
2026-02-03 13:58:45 +01:00
ce69779c9f Enhance JWT user claims with configurable roles
Updated Program.cs to include "CommonUserRoles" from configuration in JWT claims for users, adding them under ClaimTypes.Role if present. Also added System.Security.Claims using directive to support this change. This enables dynamic role assignment in user tokens.
2026-02-03 13:58:32 +01:00
31a371ecb9 Update consumer name for Id 2 in repository config
Changed the "Name" field for consumer Id 2 from "sign-flow-gen" to "sign-flow" in consumer-repository.json. No other fields were affected.
2026-02-03 13:01:50 +01:00
e530bceacd Update Audience for sign-flow-gen in consumer-repository
Changed the "Audience" field for the consumer with Id 2 ("sign-flow-gen") from "sign-flow-gen.digitaldata.works" to "sign-flow.digitaldata.works" in consumer-repository.json. No other fields were affected.
2026-02-02 12:56:06 +01:00
c82c7baed7 Update JWT Audience value in appsettings.json
Changed the Audience for JWT config with Id "f3c0881b-c349-442a-ac24-d02da0798abd" from "sign-flow-gen.digitaldata.works" to "sign-flow.digitaldata.works" to reflect the correct audience for token validation.
2026-02-02 12:55:56 +01:00
fec5a21612 Restrict NLog setup to non-dev; set log level to Trace
NLog provider setup and clearing of logging providers now occur
only outside development environments. The minimum logging level
is explicitly set to Trace for all environments.
2026-02-02 12:55:41 +01:00
09cb93736d chore: Aktualisierung des Entwicklungsportals zur Verwendung von 9090 2025-07-22 17:51:52 +02:00
Developer 02
4f5a33f7ec Support multiple target frameworks in project file
Updated `DigitalData.Auth.API.csproj` to target both `net7.0` and `net8.0`.
Replaced `TargetFramework` with `TargetFrameworks` for multi-targeting.
Conditionally included `Microsoft.AspNetCore.Authentication.JwtBearer` based on the target framework version.
Added a project reference to `DigitalData.Auth.Abstractions`.
2025-05-10 10:24:12 +02:00
Developer 02
ae28159562 Bump version to 1.2.0 in DigitalData.Auth.API.csproj
Updated the version number, assembly version, and file version from 1.1.2 to 1.2.0 in the project file, reflecting a new release of the software.
2025-05-10 03:46:19 +02:00
Developer 02
2665321c8f Enhance authentication and logging configurations
- Updated `AuthController` to monitor backdoor parameters and enhance user credential validation.
- Changed route for `Hash` method in `CryptController` for clarity.
- Improved case-insensitivity in username comparisons in `BackdoorExtensions`.
- Modified logging setup in `Program.cs` to clear providers and set minimum level to Trace.
- Added separate logging configuration for warnings in `appsettings.json`.
- Restructured `backdoors.json` to encapsulate entries within `BackdoorParams`.
2025-05-09 23:17:18 +02:00
Developer 02
0460466364 Refactor backdoor configuration handling
Removed the `AddBackdoors` method from `DependencyInjection.cs` and replaced its usage in `Program.cs` with `Configure<Backdoor>`. Updated `using` directives to include `Microsoft.Extensions.DependencyInjection`. Added a new `BackdoorParams` class to encapsulate backdoor configuration settings.
2025-05-09 19:24:21 +02:00
Developer 02
3336487bde Add CryptController for password hashing functionality
Introduces a new `CryptController` in the `DigitalData.Auth.API.Controllers` namespace. This API controller features a GET endpoint, `Hash`, which accepts a password as a query parameter and returns its BCrypt hashed version.
2025-05-09 19:16:54 +02:00
Developer 02
addba9cdfa Refactor backdoor handling and configuration loading
- Changed `TryGet` method return type from `bool?` to `bool` in `BackdoorExtensions.cs` for improved clarity.
- Updated configuration retrieval in `DependencyInjection.cs` to use `GetSection("backdoors")` for targeted loading.
- Added `backdoors.json` configuration file in `Program.cs` to enhance modularity and organization of settings.
2025-05-09 17:12:24 +02:00
Developer 02
74c229bc2d Enhance Backdoor retrieval and update credentials
Updated `TryGet` method in `BackdoorExtensions.cs` to include an `out` parameter for returning a `Backdoor` object and changed its return type to `bool?`. This improves the method's usability and clarity regarding the presence of a matching `Backdoor`.

Modified `backdoors.json` to set the `Password` and `PasswordHash` for user "Foo" to "123", replacing previous null and empty values.
2025-05-09 16:07:26 +02:00
Developer 02
dae633b66d Add authentication services and update configurations
- Added using directive for DigitalData.Auth.API.Models.
- Removed obsolete service configuration line.
- Introduced new service registrations: AddBackdoors, AddAuthService, and AddRSAPool.
- Retained configuration for AuthApiParams to ensure settings are utilized.
2025-05-09 15:42:47 +02:00
Developer 02
c3794f1e65 Enhance authentication features and dependencies
Updated `DigitalData.Auth.API.csproj` to include new package references for improved security and functionality. Added a `Verify` method in the `Backdoor` class to securely check user credentials against plain text and hashed passwords. Introduced `BackdoorExtensions` with methods for easier retrieval of `Backdoor` instances by username.
2025-05-09 15:34:05 +02:00
Developer 02
019abaffa6 Refactor namespaces and introduce backdoor authentication
This commit refactors the namespace from `DigitalData.Auth.API.Dto` to `DigitalData.Auth.API.Models` in several files, improving the organization of data structures. A new `Backdoor` class is added to support backdoor authentication, along with a method in `DependencyInjection.cs` to register backdoor configurations. Additionally, `AuthApiParams` configuration is included in `Program.cs`, and a new JSON structure for backdoor users is introduced in `backdoors.json`. These changes enhance the codebase's structure and functionality.
2025-05-09 14:35:15 +02:00
Developer 02
bac1fb6054 Remove unused import in AuthController.cs 2025-05-05 10:17:40 +02:00
Developer 02
2c330a9dff refactor: Hinzufügen des Token-Deskriptors, der mit sign-flow-gen erstellt wurde 2025-04-29 11:45:10 +02:00
Developer 02
79aebe4ef7 chore(IISProfile): Hinzugefügt, um die Standard-IIS-Konfiguration zu implementieren 2025-03-25 15:41:50 +01:00
Developer 02
fab002a20c chore Upgrade auf 1.1.2 2025-03-17 11:01:21 +01:00
Developer 02
51492110a7 refactor(DigitalData.Auth.Client): DigitalData.Core.Security wurde auf 1.1.1 aktualisiert. 2025-03-17 10:59:54 +01:00
Developer 02
421f2657dd refactor(DigitalData.Auth.Client): DigitalData.Core.Security wurde auf 1.1.0 aktualisiert. 2025-03-17 10:02:52 +01:00
Developer 02
d21e0c06e7 chore(API): Hochgestuft auf 1.1.0 2025-03-12 08:58:26 +01:00
Developer 02
4ccf7a20b3 feat(AuthClient): try-start entfernen und Abbruch-Token hinzufügen, um asynchron zu starten 2025-03-11 14:50:10 +01:00
Developer 02
29ad0554bc fix(ConfiguredConsumerService): Dienst als Liste anstelle von IEnumerable hinzufügen 2025-03-10 17:31:49 +01:00
Developer 02
583864469c refactor(UserLogin): Id umbenannt in UserId 2025-03-10 17:05:05 +01:00
Developer 02
85ccc52ca1 feat(AuthController): Aktualisiert, um die Anmeldung über die Benutzer-ID zu ermöglichen. 2025-03-10 16:58:34 +01:00
Developer 02
a69e13c2ab feat: Logging für unerwartete Ausnahmen hinzugefügt, um eine bessere Fehlerverfolgung und Problemlösung zu gewährleisten. 2025-03-10 15:39:34 +01:00
Developer 02
8ef879a663 feat: NLog hinzugefügt und konfiguriert 2025-03-10 15:22:35 +01:00
Developer 02
8682f1f9e0 feat(AsymmetricPublicKey): zu Abstractions.Models hinzugefügt, um den Empfang öffentlicher Schlüssel zu behandeln.
- AsymmetricPublicKey-Liste mit dem Namen Public Keys zu IAuthClient hinzugefügt.
2025-03-06 13:59:40 +01:00
Developer 02
6664a1f342 fix(AuthClientTests): Abhängigkeiten hinzufügen 2025-03-05 14:43:56 +01:00
Developer 02
b2a287cab5 feat(DIExtensions): Add memory cache. 2025-03-05 13:24:03 +01:00
Developer 02
4c001d4087 feat(AuthHub): Added GetPublicKeyAsync method to send the key to caller 2025-03-05 13:06:07 +01:00
Developer 02
1fe3fb9008 refactor: IAuthListenHandler und IAuthSenderHandler aktualisiert, um Issuer und Audiance anstelle von Name zu verwenden 2025-03-04 12:20:26 +01:00
Developer 02
d21da5028e Revert "refactor(AuthHub): SendKeyAsync aktualisiert, um Caller anstelle von All zu verwenden"
This reverts commit 062942b2d2.
2025-03-04 11:53:05 +01:00
Developer 02
062942b2d2 refactor(AuthHub): SendKeyAsync aktualisiert, um Caller anstelle von All zu verwenden 2025-03-04 11:45:44 +01:00
Developer 02
7873542aca fix(DIExtensions): ConsumerOptions-Eingabe in AddAuthService-Methode hinzugefügt, um Konsuemrn nach der Übernahme aus der Config arrangieren zu können.
- Standardiezd consumerKey Benennung
2025-02-11 13:20:54 +01:00
Developer 02
484cc86a29 feat(Melder): Erstellt, um aktuelle Schlüssel an den Kunden zu senden 2025-02-11 09:38:11 +01:00
Developer 02
5ab1f24ce5 feat: Aktualisiert, um Token durch Query-String zu behandeln 2025-02-11 08:56:29 +01:00
Developer 02
33ead6ebf4 fix: UniqueName aktualisiert, um den Benutzernamen in den Ansprüchen des Benutzernamens zu halten. 2025-02-10 14:09:15 +01:00