Пример #1
0
        public Task <ValidatedAuthorizeRequest> GetOriginalIdTokenRequestAsync(string id)
        {
            var key    = OIDCPipleLineStoreUtils.GenerateOriginalIdTokenRequestKey(id);
            var result = _memoryCache.Get <ValidatedAuthorizeRequest>(key);

            return(Task.FromResult(result));
        }
        public async Task <ValidatedAuthorizeRequest> GetOriginalIdTokenRequestAsync(string id)
        {
            var key    = OIDCPipleLineStoreUtils.GenerateOriginalIdTokenRequestKey(id);
            var result = await _cache.GetAsync(key);

            return(_binarySerializer.Deserialize <ValidatedAuthorizeRequest>(result));
        }
        public async Task DeleteStoredCacheAsync(string id)
        {
            var keyOriginal   = OIDCPipleLineStoreUtils.GenerateOriginalIdTokenRequestKey(id);
            var keyDownstream = OIDCPipleLineStoreUtils.GenerateDownstreamIdTokenResponseKey(id);
            await _cache.RemoveAsync(keyOriginal);

            await _cache.RemoveAsync(keyDownstream);
        }
Пример #4
0
        public Task DeleteStoredCacheAsync(string id)
        {
            var keyOriginal   = OIDCPipleLineStoreUtils.GenerateOriginalIdTokenRequestKey(id);
            var keyDownstream = OIDCPipleLineStoreUtils.GenerateDownstreamIdTokenResponseKey(id);

            _memoryCache.Remove(keyOriginal);
            _memoryCache.Remove(keyDownstream);
            return(Task.CompletedTask);
        }
Пример #5
0
        public Task StoreOriginalAuthorizeRequestAsync(string id, ValidatedAuthorizeRequest request)
        {
            var key = OIDCPipleLineStoreUtils.GenerateOriginalIdTokenRequestKey(id);

            _memoryCache.Set(
                key,
                request,
                TimeSpan.FromMinutes(_options.ExpirationMinutes));
            return(Task.CompletedTask);
        }
        public async Task StoreOriginalAuthorizeRequestAsync(string id, ValidatedAuthorizeRequest request)
        {
            var key = OIDCPipleLineStoreUtils.GenerateOriginalIdTokenRequestKey(id);

            var data = _binarySerializer.Serialize(request);
            DistributedCacheEntryOptions options = new DistributedCacheEntryOptions
            {
                AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(_options.ExpirationMinutes)
            };
            await _cache.SetAsync(key, data, options);
        }