Skip to content

Commit

Permalink
Merge branch 'main' into joe/principal-accessor
Browse files Browse the repository at this point in the history
  • Loading branch information
josephdecock committed Apr 30, 2024
2 parents 5b91b76 + 9c49699 commit 5657485
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 30 deletions.
8 changes: 0 additions & 8 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@
<IdentityServerVersion>7.0.4</IdentityServerVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0'">
<FrameworkVersion>6.0.26</FrameworkVersion>
<ExtensionsVersion>6.0.0</ExtensionsVersion>
<WilsonVersion>6.35.0</WilsonVersion>
<IdentityServerVersion>6.3.6</IdentityServerVersion>
</PropertyGroup>


<ItemGroup>
<!-- ASP.NET -->
<PackageReference Update="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="$(FrameworkVersion)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<UserAccessAccessTokenManagementService> _logger;
Expand All @@ -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<UserTokenManagementOptions> options,
IUserTokenEndpointService tokenEndpointService,
ILogger<UserAccessAccessTokenManagementService> logger)
Expand Down Expand Up @@ -100,11 +92,7 @@ public async Task<UserToken> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ public static ClientCredentialsTokenManagementBuilder AddClientCredentialsTokenM
{
services.TryAddSingleton<ITokenRequestSynchronization, TokenRequestSynchronization>();

services.TryAddSingleton<IClientCredentialsTokenManagementService, ClientCredentialsTokenManagementService>();
services.TryAddSingleton<IClientCredentialsTokenCache, DistributedClientCredentialsTokenCache>();
services.TryAddSingleton<IClientCredentialsTokenEndpointService, ClientCredentialsTokenEndpointService>();
services.TryAddSingleton<IClientAssertionService, DefaultClientAssertionService>();

services.TryAddSingleton<IDPoPProofService, DefaultDPoPProofService>();
services.TryAddSingleton<IDPoPKeyStore, DefaultDPoPKeyStore>();
services.TryAddSingleton<IDPoPNonceStore, DistributedDPoPNonceStore>();
services.TryAddTransient<IClientCredentialsTokenManagementService, ClientCredentialsTokenManagementService>();
services.TryAddTransient<IClientCredentialsTokenCache, DistributedClientCredentialsTokenCache>();
services.TryAddTransient<IClientCredentialsTokenEndpointService, ClientCredentialsTokenEndpointService>();
services.TryAddTransient<IClientAssertionService, DefaultClientAssertionService>();

services.TryAddTransient<IDPoPProofService, DefaultDPoPProofService>();
services.TryAddTransient<IDPoPKeyStore, DefaultDPoPKeyStore>();
services.TryAddTransient<IDPoPNonceStore, DistributedDPoPNonceStore>();

services.AddHttpClient(ClientCredentialsTokenManagementDefaults.BackChannelHttpClientName);

Expand Down
2 changes: 0 additions & 2 deletions test/Tests/Framework/TestLoggerProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ public void Dispose()
}

public IDisposable BeginScope<TState>(TState state)
#if NET8_0_OR_GREATER
where TState : notnull
#endif
{
return this;
}
Expand Down

0 comments on commit 5657485

Please sign in to comment.