<PackageReference Include="SSH.NET" Version="2024.2.0" />

AuthenticationMethod

Base class for all supported authentication methods.
using Renci.SshNet.Common; namespace Renci.SshNet { public abstract class AuthenticationMethod : IAuthenticationMethod { public abstract string Name { get; } public string Username { get; set; } public string[] AllowedAuthentications { get; set; } protected AuthenticationMethod(string username) { ThrowHelper.ThrowIfNullOrWhiteSpace(username, "username"); Username = username; } public abstract AuthenticationResult Authenticate(Session session); AuthenticationResult IAuthenticationMethod.Authenticate(ISession session) { return Authenticate((Session)session); } } }