public class DefaultKeyboardInteractiveAuthenticator extends AbstractLoggingBean implements KeyboardInteractiveAuthenticator
KeyboardInteractiveAuthenticator
where it prompts for the password.Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_KB_INTERACTIVE_ECHO_PROMPT |
static java.lang.String |
DEFAULT_KB_INTERACTIVE_INSTRUCTION |
static java.lang.String |
DEFAULT_KB_INTERACTIVE_LANG |
static java.lang.String |
DEFAULT_KB_INTERACTIVE_NAME |
static java.lang.String |
DEFAULT_KB_INTERACTIVE_PROMPT |
static DefaultKeyboardInteractiveAuthenticator |
INSTANCE |
static java.lang.String |
KB_INTERACTIVE_ECHO_PROMPT_PROP |
static java.lang.String |
KB_INTERACTIVE_INSTRUCTION_PROP |
static java.lang.String |
KB_INTERACTIVE_LANG_PROP |
static java.lang.String |
KB_INTERACTIVE_NAME_PROP |
static java.lang.String |
KB_INTERACTIVE_PROMPT_PROP |
log
NONE
Constructor and Description |
---|
DefaultKeyboardInteractiveAuthenticator() |
Modifier and Type | Method and Description |
---|---|
boolean |
authenticate(ServerSession session,
java.lang.String username,
java.util.List<java.lang.String> responses)
Called to authenticate the response to the challenge(s) sent previously
|
InteractiveChallenge |
generateChallenge(ServerSession session,
java.lang.String username,
java.lang.String lang,
java.lang.String subMethods)
Generates the interactive "challenge" to send to the client
|
protected java.lang.String |
getInteractionInstruction(ServerSession session) |
protected java.lang.String |
getInteractionLanguage(ServerSession session) |
protected java.lang.String |
getInteractionName(ServerSession session) |
protected java.lang.String |
getInteractionPrompt(ServerSession session) |
protected boolean |
isInteractionPromptEchoEnabled(ServerSession session) |
getSimplifiedLogger
public static final java.lang.String KB_INTERACTIVE_NAME_PROP
public static final java.lang.String DEFAULT_KB_INTERACTIVE_NAME
public static final java.lang.String KB_INTERACTIVE_INSTRUCTION_PROP
public static final java.lang.String DEFAULT_KB_INTERACTIVE_INSTRUCTION
public static final java.lang.String KB_INTERACTIVE_LANG_PROP
public static final java.lang.String DEFAULT_KB_INTERACTIVE_LANG
public static final java.lang.String KB_INTERACTIVE_PROMPT_PROP
public static final java.lang.String DEFAULT_KB_INTERACTIVE_PROMPT
public static final java.lang.String KB_INTERACTIVE_ECHO_PROMPT_PROP
public static final boolean DEFAULT_KB_INTERACTIVE_ECHO_PROMPT
public static final DefaultKeyboardInteractiveAuthenticator INSTANCE
public DefaultKeyboardInteractiveAuthenticator()
public InteractiveChallenge generateChallenge(ServerSession session, java.lang.String username, java.lang.String lang, java.lang.String subMethods)
KeyboardInteractiveAuthenticator
generateChallenge
in interface KeyboardInteractiveAuthenticator
session
- The ServerSession
through which the request was receivedusername
- The usernamelang
- The language tagsubMethods
- Sub-methods hints sent by the clientInteractiveChallenge
- if null
then authentication
attempt via "keyboard-interactive" method is rejectedpublic boolean authenticate(ServerSession session, java.lang.String username, java.util.List<java.lang.String> responses) throws java.lang.Exception
KeyboardInteractiveAuthenticator
authenticate
in interface KeyboardInteractiveAuthenticator
session
- The ServerSession
through which the response was receivedusername
- The usernameresponses
- 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 clienttrue
if responses have been validatedjava.lang.Exception
- if bad responses and server should terminate the connectionprotected java.lang.String getInteractionName(ServerSession session)
protected java.lang.String getInteractionInstruction(ServerSession session)
protected java.lang.String getInteractionLanguage(ServerSession session)
protected java.lang.String getInteractionPrompt(ServerSession session)
protected boolean isInteractionPromptEchoEnabled(ServerSession session)