diff --git a/Directory.Build.targets b/Directory.Build.targets index da21df5..65ae05e 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -6,14 +6,6 @@ 7.0.4 - - 6.0.26 - 6.0.0 - 6.35.0 - 6.3.6 - - - diff --git a/src/Duende.AccessTokenManagement.OpenIdConnect/UserAccessTokenManagementService.cs b/src/Duende.AccessTokenManagement.OpenIdConnect/UserAccessTokenManagementService.cs index a54465e..833bf29 100755 --- a/src/Duende.AccessTokenManagement.OpenIdConnect/UserAccessTokenManagementService.cs +++ b/src/Duende.AccessTokenManagement.OpenIdConnect/UserAccessTokenManagementService.cs @@ -19,11 +19,7 @@ public class UserAccessAccessTokenManagementService : IUserTokenManagementServic { private readonly IUserTokenRequestSynchronization _sync; private readonly IUserTokenStore _userAccessTokenStore; -#if NET8_0_OR_GREATER private readonly TimeProvider _clock; -#else - private readonly ISystemClock _clock; -#endif private readonly UserTokenManagementOptions _options; private readonly IUserTokenEndpointService _tokenEndpointService; private readonly ILogger _logger; @@ -40,11 +36,7 @@ public class UserAccessAccessTokenManagementService : IUserTokenManagementServic public UserAccessAccessTokenManagementService( IUserTokenRequestSynchronization sync, IUserTokenStore userAccessTokenStore, -#if NET8_0_OR_GREATER TimeProvider clock, -#else - ISystemClock clock, -#endif IOptions options, IUserTokenEndpointService tokenEndpointService, ILogger logger) @@ -100,11 +92,7 @@ public async Task GetAccessTokenAsync( } var dtRefresh = userToken.Expiration.Subtract(_options.RefreshBeforeExpiration); -#if NET8_0_OR_GREATER var utcNow = _clock.GetUtcNow(); -#else - var utcNow = _clock.UtcNow; -#endif if (dtRefresh < utcNow || parameters.ForceRenewal || needsRenewal) { _logger.LogDebug("Token for user {user} needs refreshing.", userName); diff --git a/src/Duende.AccessTokenManagement/ClientCredentialsTokenManagementServiceCollectionExtensions.cs b/src/Duende.AccessTokenManagement/ClientCredentialsTokenManagementServiceCollectionExtensions.cs index 2e17a1a..0d8c847 100644 --- a/src/Duende.AccessTokenManagement/ClientCredentialsTokenManagementServiceCollectionExtensions.cs +++ b/src/Duende.AccessTokenManagement/ClientCredentialsTokenManagementServiceCollectionExtensions.cs @@ -39,14 +39,14 @@ public static ClientCredentialsTokenManagementBuilder AddClientCredentialsTokenM { services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); + services.TryAddTransient(); + services.TryAddTransient(); + services.TryAddTransient(); + services.TryAddTransient(); + + services.TryAddTransient(); + services.TryAddTransient(); + services.TryAddTransient(); services.AddHttpClient(ClientCredentialsTokenManagementDefaults.BackChannelHttpClientName); diff --git a/test/Tests/Framework/TestLoggerProvider.cs b/test/Tests/Framework/TestLoggerProvider.cs index f541ab9..d0837dc 100644 --- a/test/Tests/Framework/TestLoggerProvider.cs +++ b/test/Tests/Framework/TestLoggerProvider.cs @@ -23,9 +23,7 @@ public void Dispose() } public IDisposable BeginScope(TState state) -#if NET8_0_OR_GREATER where TState : notnull -#endif { return this; }