AuthenticationMethod
Base class for all supported authentication methods.
using Renci.SshNet.Common;
using System;
namespace Renci.SshNet
{
public abstract class AuthenticationMethod : IAuthenticationMethod, IDisposable
{
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);
}
protected virtual void Dispose(bool disposing)
{
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
}
}