AuthFailed Event
Reports user authentication failure.
Syntax
public event OnAuthFailedHandler OnAuthFailed; public delegate void OnAuthFailedHandler(object sender, SftpserverAuthFailedEventArgs e); public class SftpserverAuthFailedEventArgs : EventArgs { public long ConnectionID { get; } public string Username { get; } public int AuthType { get; } }
Public Event OnAuthFailed As OnAuthFailedHandler Public Delegate Sub OnAuthFailedHandler(sender As Object, e As SftpserverAuthFailedEventArgs) Public Class SftpserverAuthFailedEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Username As String Public ReadOnly Property AuthType As Integer End Class
Remarks
ConnectionID identifies the session, Username specify client's username, and AuthType specifies what authentication type was used.
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 |