Esempio n. 1
0
 private void RemoveClaimsCache()
 {
     try
     {
         ClaimsCache.Remove(CacheKeyGenerator.GetClaimsKey(Identity));
     }
     catch (Exception ex)
     {
         Logger.Technical.From <AppPrincipalFactory>().Exception(ex).Log();
     }
 }
Esempio n. 2
0
 // must be refactored => Take this based on a strategy based on the .Net code.
 private List <ClaimDto> GetClaimsFromCache(ClaimsIdentity identity)
 {
     try
     {
         var secureClaims = ClaimsCache.Get <List <ClaimDto> >(CacheKeyGenerator.GetClaimsKey(identity));
         return(secureClaims ?? new List <ClaimDto>());
     }
     catch (Exception)
     {
         return(new List <ClaimDto>());
     }
 }
Esempio n. 3
0
        private void SaveClaimsToCache(IEnumerable <Claim> claims)
        {
            var dto = claims.Select(c => new ClaimDto(c.Type, c.Value)).ToList();

            try
            {
                ClaimsCache.Put(CacheKeyGenerator.GetClaimsKey(Identity), dto);
            }
            catch (Exception ex)
            {
                Logger.Technical.From <AppPrincipalFactory>().Exception(ex).Log();
            }
        }