public override SessionSecurityToken Get(SessionSecurityTokenCacheKey key) { var resLocal = _internalCache.Get(key); if (resLocal == null) { var token = cache.Get(new bUtility.TokenCache.Types.SessionSecurity.SessionCacheKey { EndpointId = key.EndpointId, ContextId = key?.ContextId?.ToString(), KeyGeneration = GetKeyGenerationString(key) }); if (token != null) { resLocal = token; _internalCache.AddOrUpdate(key, token, token.KeyExpirationTime); } } return(resLocal); }
public override SessionSecurityToken Get(SessionSecurityTokenCacheKey key) { var resLocal = _internalCache.Get(key); if (resLocal == null) { ApiHelperAsync helper = new ApiHelperAsync(_httpClient); var token = helper.Get(new SessionCacheKey() { EndpointId = key.EndpointId, ContextId = GetContextIdString(key), KeyGeneration = GetKeyGenerationString(key) }); if (token != null) { resLocal = token; _internalCache.AddOrUpdate(key, token, token.KeyExpirationTime); } } return(resLocal); }