Top Description Fields Constructors Methods
org.apache.sshd.server.auth.keyboard

public Class DefaultKeyboardInteractiveAuthenticator

extends AbstractLoggingBean
implements KeyboardInteractiveAuthenticator
Class Inheritance
All Implemented Interfaces
org.apache.sshd.server.auth.keyboard.KeyboardInteractiveAuthenticator
Imports
java.util.List, org.apache.sshd.common.RuntimeSshException, .SshException, org.apache.sshd.common.util.GenericUtils, org.apache.sshd.common.util.logging.AbstractLoggingBean, org.apache.sshd.core.CoreModuleProperties, org.apache.sshd.server.auth.password.PasswordAuthenticator, org.apache.sshd.server.session.ServerSession

Provides a default implementation for KeyboardInteractiveAuthenticator where it prompts for the password.
Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
public static final DefaultKeyboardInteractiveAuthenticator
Inherited from org.apache.sshd.common.util.logging.AbstractLoggingBean:
log

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
authenticate(ServerSession
The ServerSession through which the response was received
session
,
String
The username
username
,
List<String>
The received responses - Note: it is up to the authenticator to make sure that the number of responses matches the number of prompts sent in the initial challenge. The order of the responses matches the order of the prompts sent to the client
responses
)

Implements org.apache.sshd.server.auth.keyboard.KeyboardInteractiveAuthenticator.authenticate.

Called to authenticate the response to the challenge(s) sent previously

public InteractiveChallenge
generateChallenge(ServerSession
The ServerSession through which the request was received
session
,
String
The username
username
,
String
The language tag
lang
,
String
Sub-methods hints sent by the client
subMethods
)

Implements org.apache.sshd.server.auth.keyboard.KeyboardInteractiveAuthenticator.generateChallenge.

Generates the interactive "challenge" to send to the client

protected String
protected String
protected String
protected String
protected boolean
Inherited from org.apache.sshd.common.util.logging.AbstractLoggingBean:
debugdebugdebugdebugdebugerrorerrorerrorerrorerrorgetSimplifiedLoggerinfoinfowarnwarnwarnwarnwarnwarnwarnwarn

Field Detail

INSTANCEback to summary
public static final DefaultKeyboardInteractiveAuthenticator INSTANCE

Constructor Detail

DefaultKeyboardInteractiveAuthenticatorback to summary
public DefaultKeyboardInteractiveAuthenticator()

Method Detail

authenticateback to summary
public boolean authenticate(ServerSession session, String username, List<String> responses) throws Exception

Implements org.apache.sshd.server.auth.keyboard.KeyboardInteractiveAuthenticator.authenticate.

Doc from org.apache.sshd.server.auth.keyboard.KeyboardInteractiveAuthenticator.authenticate.

Called to authenticate the response to the challenge(s) sent previously

Parameters
session:ServerSession

The ServerSession through which the response was received

username:String

The username

responses:List<String>

The received responses - Note: it is up to the authenticator to make sure that the number of responses matches the number of prompts sent in the initial challenge. The order of the responses matches the order of the prompts sent to the client

Returns:boolean

true if responses have been validated

Annotations
@Override
Exceptions
Exception:
if bad responses and server should terminate the connection
generateChallengeback to summary
public InteractiveChallenge generateChallenge(ServerSession session, String username, String lang, String subMethods) throws Exception

Implements org.apache.sshd.server.auth.keyboard.KeyboardInteractiveAuthenticator.generateChallenge.

Doc from org.apache.sshd.server.auth.keyboard.KeyboardInteractiveAuthenticator.generateChallenge.

Generates the interactive "challenge" to send to the client

Parameters
session:ServerSession

The ServerSession through which the request was received

username:String

The username

lang:String

The language tag

subMethods:String

Sub-methods hints sent by the client

Returns:InteractiveChallenge

The InteractiveChallenge - if null then authentication attempt via "keyboard-interactive" method is rejected

Annotations
@Override
Exceptions
Exception:
If unable to generate the challenge
getInteractionInstructionback to summary
protected String getInteractionInstruction(ServerSession session)
getInteractionLanguageback to summary
protected String getInteractionLanguage(ServerSession session)
getInteractionNameback to summary
protected String getInteractionName(ServerSession session)
getInteractionPromptback to summary
protected String getInteractionPrompt(ServerSession session)
isInteractionPromptEchoEnabledback to summary
protected boolean isInteractionPromptEchoEnabled(ServerSession session)