ComponentPro UltimateSftp

      Authenticate with NTLM

      Language Filter: AllSend comments on this topic to ComponentPro

      This example demonstrates how to use the GSSAPI NTLM authentication mechanism if the server supports it.

      With single sign-on

      // Create a new class instance. 
      using (Sftp client = new Sftp())
      {            
          // Connect to the SFTP server. 
          client.Connect("myserver");
      
          // Initialize GSSAPI for NTLM single sign-on 
          SecureShellGssApiCredentials credentials = new SecureShellGssApiCredentials();
          credentials.SetMechanisms(SecureShellGssApiMechanisms.Ntlm);
      
          // Log in using NTLM single sign-on 
          client.Authenticate(credentials);
      
          // ...
      }
      

      With username/password/domain

      // Create a new class instance. 
      using (Sftp client = new Sftp())
      {
          // Connect to the SFTP server. 
          client.Connect("myserver");
      
          // Initialize GSSAPI for NTLM single sign-on 
          SecureShellGssApiCredentials credentials = new SecureShellGssApiCredentials(authUsername, authApiPassword, authDomain);
          credentials.SetMechanisms(SecureShellGssApiMechanisms.Ntlm);
      
          // Log in using NTLM 
          client.Authenticate(credentials);
      
          // ...
      }