diff --git a/DigitalData.Auth.Client/AuthClient.cs b/DigitalData.Auth.Client/AuthClient.cs index 4601509..3e4f95f 100644 --- a/DigitalData.Auth.Client/AuthClient.cs +++ b/DigitalData.Auth.Client/AuthClient.cs @@ -51,16 +51,23 @@ public class AuthClient : IAuthClient, IHostedService await GetAllPublicKeysAsync(); } + private int nOfAttempts = 0; + private async Task TryStartConnectionAsync(CancellationToken cancellationToken = default) { try { + nOfAttempts += 1; await _connection.StartAsync(cancellationToken); + _logger?.LogInformation("Auth-client connection successful. Number of connection attempts {nOfAttempts}.", nOfAttempts); return true; } catch(HttpRequestException ex) { - _logger?.LogError(ex, "Connection is failed. {message}", ex.Message); + if (_params.RetryDelay is null) + _logger?.LogError(ex, "Auth-client connection failed. {message}", ex.Message); + else + _logger?.LogError(ex, "Auth-client connection failed and will be retried every {time} seconds. The status of being successful can be followed from the information logs.\n{message}", _params.RetryDelay.Value.TotalSeconds, ex.Message); return false; } } diff --git a/DigitalData.Auth.Client/DigitalData.Auth.Client.csproj b/DigitalData.Auth.Client/DigitalData.Auth.Client.csproj index e21aaa0..e5a6f22 100644 --- a/DigitalData.Auth.Client/DigitalData.Auth.Client.csproj +++ b/DigitalData.Auth.Client/DigitalData.Auth.Client.csproj @@ -5,7 +5,7 @@ enable enable DigitalData.Auth.Client - 1.2.1.1 + 1.3.1 DigitalData.Auth.Client is a SignalR-based authentication client that enables applications to connect to a central authentication hub for real-time message exchange. It provides seamless connection management, automatic reconnection (RetryPolicy), and event-driven communication (ClientEvents). The package includes dependency injection support via DIExtensions, allowing easy integration into ASP.NET Core applications. With built-in retry policies and secure message handling, it ensures a reliable and scalable authentication client for real-time authentication workflows. Digital Data GmbH Digital Data GmbH @@ -14,8 +14,8 @@ auth_icon.png http://git.dd:3000/AppStd/DigitalData.Auth Digital Data Auth Authorization Authentication - 1.2.1.1 - 1.2.1.1 + 1.3.1 + 1.3.1