예제 #1
0
        internal AuthEntry GetSimpleLogin(string identifierToken)
        {
            AuthEntry result = null;

            if (SimpleAuthentication != null && SimpleAuthentication.Users.TryGetValue(identifierToken, out result))
            {
                return(result);
            }
            return(SimpleAuthentication.Users.Where(x => x.Key.Equals(identifierToken, StringComparison.OrdinalIgnoreCase)).Select(x => x.Value).FirstOrDefault());
        }
예제 #2
0
        internal bool CheckUser(string name, string password)
        {
            AuthEntry e = null;

            if (!Users.TryGetValue(name, out e))
            {
                e = Users.Where(x => x.Key.Equals(name, StringComparison.OrdinalIgnoreCase)).Select(x => x.Value).FirstOrDefault();
            }
            if (e != null)
            {
                return(e.Password == password);
            }
            return(false);
        }