AuthAttempt Event
Fires when an authentication attempt is performed.
Syntax
public event OnAuthAttemptHandler OnAuthAttempt; public delegate void OnAuthAttemptHandler(object sender, SftpclientAuthAttemptEventArgs e); public class SftpclientAuthAttemptEventArgs : EventArgs { public int AuthType { get; } }
Public Event OnAuthAttempt As OnAuthAttemptHandler Public Delegate Sub OnAuthAttemptHandler(sender As Object, e As SftpclientAuthAttemptEventArgs) Public Class SftpclientAuthAttemptEventArgs Inherits EventArgs Public ReadOnly Property AuthType As Integer End Class
Remarks
This event signals the start of an authentication attempt. The AuthType parameter specifies the authentication type. This event may be fired more than once if the client tries different authentication methods one after another.
Supported authentication types:
atRhosts | 0x01 | RHOSTS file authentication. Rarely used today. |
atPublicKey | 0x02 | Public key (sometimes called private key) authentication |
atPassword | 0x04 | Password-based authentication |
atHostbased | 0x08 | Hostbased authentication |
atKeyboard | 0x10 | Keyboard-interactive authentication. This is often used in place of generic password authentication. |
atGssWithMic | 0x20 | GSS authentication |
atGssKeyex | 0x40 | GSS authentication with key exchange |
atPublicKeyAgent | 0x80 | Public key agent authentication |