예제 #1
0
        /// <summary>
        /// Returns the user's security stamp
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public string GetSecurityStamp(string userId)
        {
            ConnectionService.ThreadVanityUrl = ConnectionName;

            string stamp = null;

            AspNetUsersQuery q = new AspNetUsersQuery();

            q.Select(q.SecurityStamp);
            q.Where(q.Id == userId);

            AspNetUsers user = new AspNetUsers();

            SetConnection(user);
            if (user.Load(q))
            {
                stamp = user.SecurityStamp;
            }

            return(stamp);
        }
예제 #2
0
        /// <summary>
        /// Returns a User ID given a user name
        /// </summary>
        /// <param name="userName">The user's name</param>
        /// <returns></returns>
        public string GetUserId(string userName)
        {
            ConnectionService.ThreadVanityUrl = ConnectionName;

            string userId = null;

            AspNetUsersQuery q = new AspNetUsersQuery();

            q.Select(q.Id);
            q.Where(q.UserName == userName);

            AspNetUsers user = new AspNetUsers();

            SetConnection(user);
            if (user.Load(q))
            {
                userId = user.Id;
            }

            return(userId);
        }
예제 #3
0
        /// <summary>
        /// Return the user's password hash
        /// </summary>
        /// <param name="userId">The user's id</param>
        /// <returns></returns>
        public string GetPasswordHash(string userId)
        {
            ConnectionService.ThreadVanityUrl = ConnectionName;

            string passwordHash = null;

            AspNetUsersQuery q = new AspNetUsersQuery();

            q.Select(q.PasswordHash);
            q.Where(q.Id == userId);

            AspNetUsers user = new AspNetUsers();

            SetConnection(user);
            if (user.Load(q))
            {
                passwordHash = user.PasswordHash;
            }

            return(passwordHash);
        }