From de114bf4f8b75eec890839e6ba3c910915e93b1c Mon Sep 17 00:00:00 2001 From: Jenny Ferries Date: Wed, 24 Jun 2020 10:55:47 -0700 Subject: [PATCH] rename slidingexpiration to match what's used in asp net --- .../InMemory/MsalMemoryTokenCacheOptions.cs | 8 ++++---- .../InMemory/MsalMemoryTokenCacheProvider.cs | 2 +- .../TestHelpers/MsalTestTokenCacheProvider.cs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Microsoft.Identity.Web/TokenCacheProviders/InMemory/MsalMemoryTokenCacheOptions.cs b/src/Microsoft.Identity.Web/TokenCacheProviders/InMemory/MsalMemoryTokenCacheOptions.cs index 011c4d157..1c1a6015a 100644 --- a/src/Microsoft.Identity.Web/TokenCacheProviders/InMemory/MsalMemoryTokenCacheOptions.cs +++ b/src/Microsoft.Identity.Web/TokenCacheProviders/InMemory/MsalMemoryTokenCacheOptions.cs @@ -14,7 +14,7 @@ public class MsalMemoryTokenCacheOptions /// By default, the sliding expiration is set for 14 days. public MsalMemoryTokenCacheOptions() { - SlidingExpiration = TimeSpan.FromDays(14); + AbsoluteExpirationRelativeToNow = TimeSpan.FromDays(14); } /// @@ -23,12 +23,12 @@ public MsalMemoryTokenCacheOptions() /// In production, a higher value, up-to 90 days is recommended. /// /// - /// The SlidingExpiration value. + /// The AbsoluteExpirationRelativeToNow value. /// - public TimeSpan SlidingExpiration + public TimeSpan AbsoluteExpirationRelativeToNow { get; set; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.Identity.Web/TokenCacheProviders/InMemory/MsalMemoryTokenCacheProvider.cs b/src/Microsoft.Identity.Web/TokenCacheProviders/InMemory/MsalMemoryTokenCacheProvider.cs index f7724046a..061a19654 100644 --- a/src/Microsoft.Identity.Web/TokenCacheProviders/InMemory/MsalMemoryTokenCacheProvider.cs +++ b/src/Microsoft.Identity.Web/TokenCacheProviders/InMemory/MsalMemoryTokenCacheProvider.cs @@ -77,7 +77,7 @@ protected override Task ReadCacheBytesAsync(string cacheKey) /// Bytes to write. protected override Task WriteCacheBytesAsync(string cacheKey, byte[] bytes) { - _memoryCache.Set(cacheKey, bytes, _cacheOptions.SlidingExpiration); + _memoryCache.Set(cacheKey, bytes, _cacheOptions.AbsoluteExpirationRelativeToNow); return Task.CompletedTask; } } diff --git a/tests/Microsoft.Identity.Web.Test.Common/TestHelpers/MsalTestTokenCacheProvider.cs b/tests/Microsoft.Identity.Web.Test.Common/TestHelpers/MsalTestTokenCacheProvider.cs index e6114c55c..babe901db 100644 --- a/tests/Microsoft.Identity.Web.Test.Common/TestHelpers/MsalTestTokenCacheProvider.cs +++ b/tests/Microsoft.Identity.Web.Test.Common/TestHelpers/MsalTestTokenCacheProvider.cs @@ -44,7 +44,7 @@ protected override Task RemoveKeyAsync(string cacheKey) protected override Task WriteCacheBytesAsync(string cacheKey, byte[] bytes) { - MemoryCache.Set(cacheKey, bytes, _cacheOptions.SlidingExpiration); + MemoryCache.Set(cacheKey, bytes, _cacheOptions.AbsoluteExpirationRelativeToNow); Count++; return Task.CompletedTask; }