示例#1
0
 /// <summary>Sets the Auth data to empty</summary>
 /// <param name="AuthType">The Auth type, although it doesn't matter what it's set to this overload will set it to "None"</param>
 public void Authdata(GlobalDS.AuthType AuthType)
 {
     _AuthUser             = string.Empty;
     _AuthPassword         = string.Empty;
     _AuthDomain           = string.Empty;
     _AuthenticationMethod = GlobalDS.AuthType.None;
     if (AuthType != GlobalDS.AuthType.None)
     {
         throw new Exception("Missing Information, AuthType set to 'None'");
     }
     return;
 }
示例#2
0
        private void ExtractAuthenticationDataFromXml(ref XmlNode TargetNode)
        {
            XmlNode AuthDataNode = TargetNode.SelectSingleNode("authentication");

            if (AuthDataNode == null || AuthDataNode.Attributes["authtype"] == null || !System.Enum.IsDefined(typeof(GlobalDS.AuthType), AuthDataNode.Attributes["authtype"].InnerText)) // Older Data file
            {
                _AuthenticationMethod = GlobalDS.AuthType.None;
                _AuthUser             = string.Empty;
                _AuthPassword         = string.Empty;
                _AuthDomain           = string.Empty;
                return;
            }

            _AuthenticationMethod = (GlobalDS.AuthType)System.Enum.Parse(typeof(GlobalDS.AuthType), AuthDataNode.Attributes["authtype"].InnerText);

            XmlNode tmpnode = AuthDataNode.SelectSingleNode("username");

            if (tmpnode == null || tmpnode.Attributes["value"] == null)
            {
                _AuthUser = string.Empty;
            }
            else
            {
                _AuthUser = tmpnode.Attributes["value"].InnerText;
            }

            tmpnode = AuthDataNode.SelectSingleNode("password");
            if (tmpnode == null || tmpnode.Attributes["value"] == null)
            {
                _AuthPassword = string.Empty;
            }
            else
            {
                _AuthPassword = tmpnode.Attributes["value"].InnerText;
            }

            tmpnode = AuthDataNode.SelectSingleNode("domain");
            if (tmpnode == null || tmpnode.Attributes["value"] == null)
            {
                _AuthDomain = string.Empty;
            }
            else
            {
                _AuthDomain = tmpnode.Attributes["value"].InnerText;
            }

            return;
        }
示例#3
0
        /// <summary>Sets the authentication data</summary>
        /// <param name="AuthType">The authentication type</param>
        /// <param name="Credentials">The authentication credentials</param>
        public void Authdata(GlobalDS.AuthType AuthType, System.Net.NetworkCredential Credentials)
        {
            _AuthUser     = Credentials.UserName;
            _AuthPassword = Credentials.Password;
            _AuthDomain   = Credentials.Domain;

            if (AuthType == GlobalDS.AuthType.None)
            {
                Authdata(AuthType); return;
            }

            _AuthenticationMethod = AuthType;

            if (AuthType != GlobalDS.AuthType.NTLM)
            {
                _AuthDomain = string.Empty;
            }
        }
示例#4
0
        /// <summary>Sets the authentication data</summary>
        /// <param name="AuthType">The authentication type</param>
        /// <param name="Username">The authentication username</param>
        /// <param name="Password">The authentication password</param>
        public void Authdata(GlobalDS.AuthType AuthType, string Username, string Password)
        {
            _AuthUser     = Username;
            _AuthPassword = Password;
            _AuthDomain   = string.Empty;

            if (AuthType == GlobalDS.AuthType.None)
            {
                Authdata(AuthType); return;
            }

            _AuthenticationMethod = AuthType;

            if (AuthType == GlobalDS.AuthType.NTLM)
            {
                _AuthenticationMethod = GlobalDS.AuthType.Basic;
                throw new Exception("Missing Domain information, AuthType set to 'Basic'");
            }
        }
示例#5
0
		/// <summary>Sets the authentication data</summary>
		/// <param name="AuthType">The authentication type</param>
		/// <param name="Credentials">The authentication credentials</param>
        public void Authdata(GlobalDS.AuthType AuthType, System.Net.NetworkCredential Credentials)
		{
			_AuthUser = Credentials.UserName;
			_AuthPassword = Credentials.Password;
			_AuthDomain = Credentials.Domain;

            if (AuthType == GlobalDS.AuthType.None)
			{
				Authdata(AuthType); return;
			}

			_AuthenticationMethod = AuthType;

            if (AuthType != GlobalDS.AuthType.NTLM)
				_AuthDomain = string.Empty;
		
		}
示例#6
0
		/// <summary>Sets the authentication data</summary>
		/// <param name="AuthType">The authentication type</param>
		/// <param name="Username">The authentication username</param>
		/// <param name="Password">The authentication password</param>
        public void Authdata(GlobalDS.AuthType AuthType, string Username, string Password)
		{
			_AuthUser = Username;
			_AuthPassword = Password;
			_AuthDomain = string.Empty;

            if (AuthType == GlobalDS.AuthType.None)
			{
				Authdata(AuthType); return;
			}

			_AuthenticationMethod = AuthType;

            if (AuthType == GlobalDS.AuthType.NTLM)
			{
                _AuthenticationMethod = GlobalDS.AuthType.Basic;
				throw new Exception("Missing Domain information, AuthType set to 'Basic'");
			}

		}
示例#7
0
		/// <summary>Sets the Auth data to empty</summary>
		/// <param name="AuthType">The Auth type, although it doesn't matter what it's set to this overload will set it to "None"</param>
        public void Authdata(GlobalDS.AuthType AuthType)
		{
			_AuthUser = string.Empty;
			_AuthPassword = string.Empty;
			_AuthDomain = string.Empty;
            _AuthenticationMethod = GlobalDS.AuthType.None;
            if (AuthType != GlobalDS.AuthType.None)
			{ throw new Exception("Missing Information, AuthType set to 'None'"); }
			return;
		}
示例#8
0
		private void ExtractAuthenticationDataFromXml(ref XmlNode TargetNode)
		{
			XmlNode AuthDataNode = TargetNode.SelectSingleNode("authentication");

            if (AuthDataNode == null || AuthDataNode.Attributes["authtype"] == null || !System.Enum.IsDefined(typeof(GlobalDS.AuthType), AuthDataNode.Attributes["authtype"].InnerText)) // Older Data file
			{
                _AuthenticationMethod = GlobalDS.AuthType.None;
				_AuthUser = string.Empty;
				_AuthPassword = string.Empty;
				_AuthDomain = string.Empty;
				return;
			}

            _AuthenticationMethod = (GlobalDS.AuthType)System.Enum.Parse(typeof(GlobalDS.AuthType), AuthDataNode.Attributes["authtype"].InnerText);

			XmlNode tmpnode = AuthDataNode.SelectSingleNode("username");
			if (tmpnode == null || tmpnode.Attributes["value"] == null)
				_AuthUser = string.Empty;
			else
				_AuthUser = tmpnode.Attributes["value"].InnerText;

			tmpnode = AuthDataNode.SelectSingleNode("password");
			if (tmpnode == null || tmpnode.Attributes["value"] == null)
				_AuthPassword = string.Empty;
			else
				_AuthPassword = tmpnode.Attributes["value"].InnerText;

			tmpnode = AuthDataNode.SelectSingleNode("domain");
			if (tmpnode == null || tmpnode.Attributes["value"] == null)
				_AuthDomain = string.Empty;
			else
				_AuthDomain = tmpnode.Attributes["value"].InnerText;

			return;
		}