This how the code from SCPClient class looks like:
public void setAuthentication(String userName, String password, PasswordChanger pwdChanger)
throws FTPException
{
checkConnection(false);
PasswordAuthenticationClient localPasswordAuthenticationClient = new PasswordAuthenticationClient();
localPasswordAuthenticationClient.setUsername(userName);
localPasswordAuthenticationClient.setPassword(password);
localPasswordAuthenticationClient.setPasswordChangePrompt(pwdChanger);
this.authenticator = localPasswordAuthenticationClient;
KBIAuthenticationClient localKBIAuthenticationClient = new KBIAuthenticationClient();
localKBIAuthenticationClient.setUsername(userName);
SSHAuthPrompt[] arrayOfSSHAuthPrompt = new SSHAuthPrompt[1];
arrayOfSSHAuthPrompt[0] = new SSHPasswordPrompt(password);
localKBIAuthenticationClient.setKBIRequestHandler(new b(arrayOfSSHAuthPrompt));
this.retryAuthenticator = localKBIAuthenticationClient;
}
So retry is indeed automatically enabled; maybe this is documented in the guides and I've missed that part (the API specs, however, don't mention this behavior); in my opinion it may be useful to also have a "password only" without the fallback: in our case, using EDT, we've built a CLI ftp client tool to connect to a Apache Mina Core SFTP server (also under our control), so we want the FTP client to only use the password with which it has been configured (no interactive "enter password", even if it is CLI), without asking any other arguments in the CLI.