AuthPassword Event
This event is fired on password authentication attempt from a client.
Syntax
public event OnAuthPasswordHandler OnAuthPassword; public delegate void OnAuthPasswordHandler(object sender, SftpserverAuthPasswordEventArgs e); public class SftpserverAuthPasswordEventArgs : EventArgs { public long ConnectionID { get; } public string Username { get; } public string Password { get; } public bool Accept { get; set; } public bool ForceChangePassword { get; set; } }
Public Event OnAuthPassword As OnAuthPasswordHandler Public Delegate Sub OnAuthPasswordHandler(sender As Object, e As SftpserverAuthPasswordEventArgs) Public Class SftpserverAuthPasswordEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Username As String Public ReadOnly Property Password As String Public Property Accept As Boolean Public Property ForceChangePassword As Boolean End Class
Remarks
Parameters Username and Password contain user credentials. If they are correct, set Accept to true. You can request password change by setting ForceChangePassword to true.