An individual server side user credential
示例#1
0
        /// <summary>
        /// Adds the specified user to the credentials database.
        /// </summary>
        /// <param name="username"></param>
        /// <param name="userToken"></param>
        public void AddUser(string username, Guid userToken)
        {
            IntegratedSecurityUserCredential user = new IntegratedSecurityUserCredential(username, userToken);

            lock (m_users)
            {
                m_users.Add(user.UserID, user);
            }
        }
示例#2
0
        /// <summary>
        /// Loads from the supplied stream.
        /// </summary>
        /// <param name="stream"></param>
        public void Load(Stream stream)
        {
            byte version = stream.ReadNextByte();

            switch (version)
            {
            case 1:
                lock (m_users)
                {
                    int count = stream.ReadInt32();
                    m_users.Clear();
                    while (count > 0)
                    {
                        count--;
                        IntegratedSecurityUserCredential user = new IntegratedSecurityUserCredential(stream);
                        m_users.Add(user.UserID, user);
                    }
                }
                return;

            default:
                throw new VersionNotFoundException("Unknown encoding method");
            }
        }
 /// <summary>
 /// Adds the specified user to the credentials database.
 /// </summary>
 /// <param name="username"></param>
 /// <param name="userToken"></param>
 public void AddUser(string username, Guid userToken)
 {
     var user = new IntegratedSecurityUserCredential(username, userToken);
     lock (m_users)
     {
         m_users.Add(user.UserID, user);
     }
 }
 /// <summary>
 /// Loads from the supplied stream.
 /// </summary>
 /// <param name="stream"></param>
 public void Load(Stream stream)
 {
     byte version = stream.ReadNextByte();
     switch (version)
     {
         case 1:
             lock (m_users)
             {
                 int count = stream.ReadInt32();
                 m_users.Clear();
                 while (count > 0)
                 {
                     count--;
                     var user = new IntegratedSecurityUserCredential(stream);
                     m_users.Add(user.UserID, user);
                 }
             }
             return;
         default:
             throw new VersionNotFoundException("Unknown encoding method");
     }
 }