Example #1
0
        public Task RemoveAsync(string key)
        {
            //Log.Info("ADFS: In RemoveAsync", this);
            AuthSessionEntry myEntry = _permStore.Entries.FindAsync(key).Result;

            if (myEntry != null)
            {
                _permStore.Entries.Remove(myEntry);
                _permStore.SaveChanges();
            }
            return(Task.FromResult(0));
        }
Example #2
0
        public Task <AuthenticationTicket> RetrieveAsync(string key)
        {
            //Log.Info("ADFS: In RetrieveAsync", this);
            //Log.Info("ADFS: RetrieveAsync call trace: " + Environment.StackTrace, this);
            AuthenticationTicket ticket  = null;
            AuthSessionEntry     myEntry = _permStore.Entries.FindAsync(key).Result;

            if (myEntry != null)
            {
                ticket = _formatter.Unprotect(myEntry.TicketString);
            }
            return(Task.FromResult(ticket));
        }
Example #3
0
        public Task RenewAsync(string key, AuthenticationTicket ticket)
        {
            //Log.Info("ADFS: In RenewAsync", this)
            AuthSessionEntry myEntry = _permStore.Entries.FindAsync(key).Result;

            if (myEntry != null)
            {
                myEntry.TicketString = _formatter.Protect(ticket);
            }
            else
            {
                _permStore.Entries.Add(new AuthSessionEntry {
                    Key = key, TicketString = _formatter.Protect(ticket)
                });
            }
            _permStore.SaveChanges();
            return(Task.FromResult(0));
        }