Ejemplo n.º 1
0
 protected override void OnTokenAdded(IssuedTokenCacheBase.Key key, GenericXmlSecurityToken token)
 {
     using (FileStream fileStream = File.Open(this.fileName, FileMode.Append, FileAccess.Write))
     {
         fileStream.Seek(0L, SeekOrigin.End);
         FileIssuedTokenCache.SerializeCachedToken(fileStream, key.Target, key.Issuer, token);
     }
 }
Ejemplo n.º 2
0
 protected override void OnTokenRemoved(IssuedTokenCacheBase.Key key)
 {
     using (FileStream fileStream = File.Open(this.fileName, FileMode.Append, FileAccess.Write))
     {
         fileStream.Seek(0L, SeekOrigin.Begin);
         foreach (IssuedTokenCacheBase.Key key2 in base.Cache.Keys)
         {
             GenericXmlSecurityToken token = base.Cache[key2];
             FileIssuedTokenCache.SerializeCachedToken(fileStream, key.Target, key.Issuer, token);
         }
     }
 }
Ejemplo n.º 3
0
 public FileIssuedTokenCache(string fileName)
 {
     this.fileName = fileName;
     if (File.Exists(fileName))
     {
         using (FileStream fileStream = File.Open(fileName, FileMode.OpenOrCreate, FileAccess.Read))
         {
             fileStream.Seek(0L, SeekOrigin.Begin);
             FileIssuedTokenCache.PopulateCache(base.Cache, fileStream);
         }
     }
 }