Sholo.Web.Security/Authentication/User/Provider/CacheUserAuthenticationTicketProvider.cs
/// <summary>
/// Retrieves all non-expired tickets in the ticket store associated with the 
/// username supplied.
/// </summary>
/// <param name="username">The Username to search the collection for</param>
/// <returns>An enumerable collection of ServerAuthenticationTickets</returns>
/// <exception cref="ArgumentNullException">username is null</exception>
/// <exception cref="ArgumentException">username is empty</exception>
Retrieves all non-expired tickets in the ticket store associated with the
username supplied.
Retrieves all non - expired tickets in the ticket store associated with the username supplied .
public override IEnumerable<UserAuthenticationTicket> GetUserTickets(string username)
        {
            if (username == null)
            {
                throw new ArgumentNullException("username", "username parameter cannot be null or empty.");
            }
            if (string.IsNullOrEmpty(username))
            {
                throw new ArgumentException("username parameter cannot be null or empty.", "username");
            }
            IDictionaryEnumerator enumerator = HttpContext.Current.Cache.GetEnumerator();
            while (enumerator.MoveNext())
            {
                string currentKey = enumerator.Entry.Key as string;
                if (currentKey != null && currentKey.StartsWith(UserTicketKeyPrefix))
                {
                    UserAuthenticationTicket currentTicket = enumerator.Entry.Value as UserAuthenticationTicket;
                    if (currentTicket != null && string.Compare(currentTicket.Username, username, StringComparison.OrdinalIgnoreCase) == 0)
                    {
                        yield return currentTicket;
                    }
                }
            }
        }
public override IEnumerable < UserAuthenticationTicket > GetUserTickets ( string username ) { if ( username == null ) { throw new ArgumentNullException ( " " , " " ) ; } if ( string . IsNullOrEmpty ( username ) ) { throw new ArgumentException ( " " , " " ) ; } IDictionaryEnumerator enumerator = HttpContext . Current . Cache . GetEnumerator ( ) ; while ( enumerator . MoveNext ( ) ) { string currentKey = enumerator . Entry . Key as string ; if ( currentKey != null && currentKey . StartsWith ( UserTicketKeyPrefix ) ) { UserAuthenticationTicket currentTicket = enumerator . Entry . Value as UserAuthenticationTicket ; if ( currentTicket != null && string . Compare ( currentTicket . Username , username , StringComparison . OrdinalIgnoreCase ) == 0 ) { yield return currentTicket ; } } } }
Retrieves all non-expired tickets in the ticket store associated with the
username supplied.
Retrieves all non - expired tickets in the ticket store associated with the username supplied .
An enumerable collection of ServerAuthenticationTickets
An enumerable collection of ServerAuthenticationTickets
username is null
username is null
username is empty
username is empty
username
string
The Username to search the collection for
The Username to search the collection for