Exemplo n.º 1
0
        /// <summary>
        /// Creates a new Credentials
        /// </summary>
        public CimCredential(ImpersonatedAuthenticationMechanism authenticationMechanism)
        {
            string strAuthenticationMechanism = null;

            if (authenticationMechanism == ImpersonatedAuthenticationMechanism.None)
            {
                strAuthenticationMechanism = MI_AuthType.NONE;
            }
            else if (authenticationMechanism == ImpersonatedAuthenticationMechanism.Negotiate)
            {
                strAuthenticationMechanism = MI_AuthType.NEGO_NO_CREDS;
            }
            else if (authenticationMechanism == ImpersonatedAuthenticationMechanism.Kerberos)
            {
                strAuthenticationMechanism = MI_AuthType.KERBEROS;
            }
            else if (authenticationMechanism == ImpersonatedAuthenticationMechanism.NtlmDomain)
            {
                strAuthenticationMechanism = MI_AuthType.NTLM;
            }
            else
            {
                throw new ArgumentOutOfRangeException("authenticationMechanism");
            }
            NativeCimCredential.CreateCimCredential(strAuthenticationMechanism, out credential);
        }
Exemplo n.º 2
0
        public CimCredential(ImpersonatedAuthenticationMechanism authenticationMechanism)
        {
            string authTypeNTLM = null;

            if (authenticationMechanism != ImpersonatedAuthenticationMechanism.None)
            {
                if (authenticationMechanism != ImpersonatedAuthenticationMechanism.Negotiate)
                {
                    if (authenticationMechanism != ImpersonatedAuthenticationMechanism.Kerberos)
                    {
                        if (authenticationMechanism != ImpersonatedAuthenticationMechanism.NtlmDomain)
                        {
                            throw new ArgumentOutOfRangeException("authenticationMechanism");
                        }
                        else
                        {
                            authTypeNTLM = AuthType.AuthTypeNTLM;
                        }
                    }
                    else
                    {
                        authTypeNTLM = AuthType.AuthTypeKerberos;
                    }
                }
                else
                {
                    authTypeNTLM = AuthType.AuthTypeNegoNoCredentials;
                }
            }
            else
            {
                authTypeNTLM = AuthType.AuthTypeNone;
            }
            NativeCimCredential.CreateCimCredential(authTypeNTLM, out this.credential);
        }
Exemplo n.º 3
0
 internal static void CreateCimCredential(ImpersonatedAuthenticationMechanism authenticationMechanism, out NativeCimCredential credential)
 {
     // TODO: Implement
     credential = new NativeCimCredential(true, new SecureString());
 }
Exemplo n.º 4
0
		public CimCredential(ImpersonatedAuthenticationMechanism authenticationMechanism)
		{
			string authTypeNTLM = null;
			if (authenticationMechanism != ImpersonatedAuthenticationMechanism.None)
			{
				if (authenticationMechanism != ImpersonatedAuthenticationMechanism.Negotiate)
				{
					if (authenticationMechanism != ImpersonatedAuthenticationMechanism.Kerberos)
					{
						if (authenticationMechanism != ImpersonatedAuthenticationMechanism.NtlmDomain)
						{
							throw new ArgumentOutOfRangeException("authenticationMechanism");
						}
						else
						{
							authTypeNTLM = AuthType.AuthTypeNTLM;
						}
					}
					else
					{
						authTypeNTLM = AuthType.AuthTypeKerberos;
					}
				}
				else
				{
					authTypeNTLM = AuthType.AuthTypeNegoNoCredentials;
				}
			}
			else
			{
				authTypeNTLM = AuthType.AuthTypeNone;
			}
			NativeCimCredential.CreateCimCredential(authTypeNTLM, out this.credential);
		}
Exemplo n.º 5
0
 public RDPCredential(ImpersonatedAuthenticationMechanism impAuth)
     : base(impAuth)
 {
 }