Discuss this help topic in SecureBlackbox Forum
FTPS: Configure user authentication
There are two ways to authenticate server users available:
C#:
Server.Users.AddFTPSUser("UserName", "Password");
Server.Users.DeleteUser("UserName");
Delphi:
Server.Users.AddFTPSUser('UserName', 'Password');
Server.Users.DeleteUser('UserName');
TElSimpleFTPSServer will check the user password during authentication.
C#:
static void Main(string[] args)
{
TElSimpleFTPSServer Server = new TElSimpleFTPSServer();
Server.OnAuthAttempt += ElSimpleFtpsServerOnOnAuthAttempt;
...
}
private static void ElSimpleFtpsServerOnOnAuthAttempt(object sender, string username, string password, ref bool allow)
{
allow = false;
SBSimpleFTPSServer.TElSimpleFTPSServerSessionThread Sender = sender as TElSimpleFTPSServerSessionThread;
try
{
User user = UserRepository.Login(username, password);
allow = true;
// Create a new instance of the filesystem adapter
Sender.FileSystemAdapter = new MyCustomFileSystemAdapter(nil);
// set the virtual root dynamically
Sender.FileSystemAdapter.BasePath = UsersVirtualRootDir;
return;
}
catch
{
}
}