diff --git a/src/Medidata.MAuth.Core/MAuthAuthenticator.cs b/src/Medidata.MAuth.Core/MAuthAuthenticator.cs index 2730afb..8197477 100644 --- a/src/Medidata.MAuth.Core/MAuthAuthenticator.cs +++ b/src/Medidata.MAuth.Core/MAuthAuthenticator.cs @@ -75,7 +75,12 @@ public MAuthAuthenticator(MAuthOptionsBase options, ILogger logger, HttpClient h _cache = cacheService ?? new MemoryCacheService(new MemoryCache(new MemoryCacheOptions())); _options = options; _logger = logger; +#if NET6_0_OR_GREATER + _lazyHttpClient = new Lazy(httpClient); +#else _lazyHttpClient = new Lazy(() => httpClient); +#endif + _dateTimeOffsetWrapper = options.DateTimeOffsetWrapper; }