Class PasswordAuthenticationMethod
- Namespace
- Renci.SshNet
- Assembly
- Renci.SshNet.dll
Provides functionality to perform password authentication.
public class PasswordAuthenticationMethod : AuthenticationMethod, IDisposableInheritance
Implements
Inherited Members
Constructors
PasswordAuthenticationMethod(string, string)
Initializes a new instance of the Renci.SshNet.PasswordAuthenticationMethod class.
public PasswordAuthenticationMethod(string username, string password)Parameters
Exceptions
- ArgumentException
-
usernameis whitespace or null. - ArgumentException
-
passwordis null.
PasswordAuthenticationMethod(string, byte[])
Initializes a new instance of the Renci.SshNet.PasswordAuthenticationMethod class.
public PasswordAuthenticationMethod(string username, byte[] password)Parameters
Exceptions
- ArgumentException
-
usernameis whitespace or null. - ArgumentException
-
passwordis null.
Properties
Name
Gets the name of the authentication method.
public override string Name { get; }Property Value
Methods
Authenticate(Session)
Authenticates the specified session.
public override AuthenticationResult Authenticate(Session session)Parameters
sessionSession-
The session to authenticate.
Returns
- AuthenticationResult
-
Result of authentication process.
Exceptions
- ArgumentNullException
-
sessionis null.
Dispose(bool)
Releases unmanaged and - optionally - managed resources.
protected override void Dispose(bool disposing)Parameters
disposingbool-
true to release both managed and unmanaged resources; false to release only unmanaged resources.
PasswordExpired
Occurs when user's password has expired and needs to be changed.
public event EventHandler<AuthenticationPasswordChangeEventArgs> PasswordExpired