public class Ssh1ChallengeResponseAuthentication extends Object implements SshAuthentication
Adds support for SSH1 challenge response authentication. Simply set the prompt interface on the instance so that a callback is available for the user to provide their response to the challenge.
Ssh1ChallengeResponseAuthentication auth = new Ssh1ChallengeResponseAuthentication(); auth.setPrompt(new Ssh1ChallengeResponseAuthentication.Prompt() { public String getResponse(String challenge) { try { System.out.print(challenge + ": "); return reader.readLine(); } catch (IOException ex) { return null; } } }); ssh.authenticate(auth);
Modifier and Type | Class and Description |
---|---|
static interface |
Ssh1ChallengeResponseAuthentication.Prompt |
CANCELLED, COMPLETE, FAILED, FURTHER_AUTHENTICATION_REQUIRED, PUBLIC_KEY_ACCEPTABLE
Constructor and Description |
---|
Ssh1ChallengeResponseAuthentication() |
Modifier and Type | Method and Description |
---|---|
String |
getMethod()
The SSH authentication method name
|
Ssh1ChallengeResponseAuthentication.Prompt |
getPrompt() |
String |
getUsername()
Get the username for this authentication attempt.
|
void |
setPrompt(Ssh1ChallengeResponseAuthentication.Prompt prompt) |
void |
setUsername(String username)
Set the username for this authentication attempt.
|
public String getMethod()
SshAuthentication
getMethod
in interface SshAuthentication
public String getUsername()
getUsername
in interface SshAuthentication
public void setUsername(String username)
setUsername
in interface SshAuthentication
username
- Stringpublic void setPrompt(Ssh1ChallengeResponseAuthentication.Prompt prompt)
public Ssh1ChallengeResponseAuthentication.Prompt getPrompt()
Copyright © 2024. All rights reserved.