| Dart.Ssh Namespace > SshConnection Class > Authenticate Method : Authenticate(SshLoginData) Method |
'Declaration Public Overloads Sub Authenticate( _ ByVal loginData As SshLoginData _ )
'Usage Dim instance As SshConnection Dim loginData As SshLoginData instance.Authenticate(loginData)
public void Authenticate( SshLoginData loginData )
public: void Authenticate( SshLoginData* loginData )
public: void Authenticate( SshLoginData^ loginData )
| Exception | Description |
|---|---|
| System.Security.Authentication.AuthenticationException | Authentication was unsuccessful. |
| System.ArgumentException | One or more of the details provided in loginData is invalid, or required and not provided. |
This method relies upon 'none' authentication to request the available authentication methods, and is driven by the server's response and the provided authentication details. The authentication method used will be selected in the order of preference: 'publickey', 'password', 'keyboard-interactive', excluding any not supported by the server or not possible with the provided authentication details. If the server reports partial success for any authentication attempt, multi-factor authentication will be attempted based upon the server's available authentication methods and the provided authentication details until authentication succeeds or an exception is thrown. This automatic multi-factor authentication is limited to 20 attempts.
If keyboard-interactive authentication is used by this method, a Challenge event handler is not required if the server only prompts for the password and loginData.Password is populated; in all other cases, a handler is required to sucessfully complete authentication. If the Challenge event is handled, the response for the password prompt will be pre-populated with the password. Note: This method will only pre-populate a response for the first prompt that contains 'password' (case-insensitive); alternative password prompts must be handled manually in the Challenge event.
The technique used to invoke this method is dependent upon the value of ThreadingModel. If ThreadingModel.Free, this method executes on the current thread and returns when complete (this is standard for creating applications in multi-threading environments like .NET). If ThreadingModel.ApartmentBlocking, this method blocks and processes windows UI messages while a worker thread executes (this is useful for making a simple blocking call in an apartment model environment like VB6). If ThreadingModel.ApartmentAsync, this method immediately returns after starting a worker thread that executes asynchronously (this is useful for creating advanced communications applications in an apartment model environment like VB6). The StateChanged event will be raised upon completion, or the Error event raised if an exception is thrown.
Note: Server support of the 'none' authentication method will never be announced by the server per RFC 4252.