Beispiel #1
0
 public MsalTestTokenCacheProvider(
     IOptions <MicrosoftIdentityOptions> microsoftIdentityOptions,
     IHttpContextAccessor httpContextAccessor,
     IMemoryCache memoryCache,
     IOptions <MsalMemoryTokenCacheOptions> cacheOptions) :
     base(microsoftIdentityOptions, httpContextAccessor)
 {
     MemoryCache   = memoryCache;
     _cacheOptions = cacheOptions.Value;
 }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BenchmarkMsalMemoryTokenCacheProvider"/> class.
        /// </summary>
        /// <param name="memoryCache">Cache instance to use.</param>
        /// <param name="cacheOptions">Options for the token cache.</param>

        public BenchmarkMsalMemoryTokenCacheProvider(
            IMemoryCache memoryCache,
            IOptions <MsalMemoryTokenCacheOptions> cacheOptions)
        {
            if (cacheOptions == null)
            {
                throw new ArgumentNullException(nameof(cacheOptions));
            }

            _memoryCache  = memoryCache;
            _cacheOptions = cacheOptions.Value;
        }