public class UserAuthKeyboardInteractive extends AbstractUserAuth
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_INTERACTIVE_LANGUAGE_TAG |
static java.lang.String |
DEFAULT_INTERACTIVE_SUBMETHODS |
private java.util.concurrent.atomic.AtomicInteger |
emptyCount |
static java.lang.String |
INTERACTIVE_LANGUAGE_TAG |
static java.lang.String |
INTERACTIVE_SUBMETHODS |
private int |
maxTrials |
static java.lang.String |
NAME |
private java.util.Iterator<java.lang.String> |
passwords |
private java.util.concurrent.atomic.AtomicBoolean |
requestPending |
private java.util.concurrent.atomic.AtomicInteger |
trialsCount |
log
BY_NAME_COMPARATOR, NAME_EXTRACTOR
Constructor and Description |
---|
UserAuthKeyboardInteractive() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getAuthCommandName(int cmd) |
protected java.lang.String |
getCurrentPasswordCandidate() |
protected java.lang.String |
getExchangeLanguageTag(ClientSession session) |
protected java.lang.String |
getExchangeSubMethods(ClientSession session) |
protected java.lang.String[] |
getUserResponses(java.lang.String name,
java.lang.String instruction,
java.lang.String lang,
java.lang.String[] prompt,
boolean[] echo) |
void |
init(ClientSession session,
java.lang.String service) |
protected boolean |
processAuthDataRequest(ClientSession session,
java.lang.String service,
Buffer buffer) |
protected boolean |
sendAuthDataRequest(ClientSession session,
java.lang.String service) |
protected boolean |
useCurrentPassword(java.lang.String password,
java.lang.String name,
java.lang.String instruction,
java.lang.String lang,
java.lang.String[] prompt,
boolean[] echo) |
protected boolean |
verifyTrialsCount(ClientSession session,
java.lang.String service,
int cmd,
int nbTrials,
int maxAllowed) |
destroy, getClientSession, getName, getService, getSession, process, toString
getSimplifiedLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
findByName, getNameList, getNames, ofName, removeByName
public static final java.lang.String NAME
public static final java.lang.String INTERACTIVE_LANGUAGE_TAG
public static final java.lang.String DEFAULT_INTERACTIVE_LANGUAGE_TAG
public static final java.lang.String INTERACTIVE_SUBMETHODS
public static final java.lang.String DEFAULT_INTERACTIVE_SUBMETHODS
private final java.util.concurrent.atomic.AtomicBoolean requestPending
private final java.util.concurrent.atomic.AtomicInteger trialsCount
private final java.util.concurrent.atomic.AtomicInteger emptyCount
private java.util.Iterator<java.lang.String> passwords
private int maxTrials
public void init(ClientSession session, java.lang.String service) throws java.lang.Exception
init
in interface UserAuth
init
in class AbstractUserAuth
session
- The ClientSession
service
- The requesting service namejava.lang.Exception
- If failed to initialize the mechanismprotected boolean sendAuthDataRequest(ClientSession session, java.lang.String service) throws java.lang.Exception
sendAuthDataRequest
in class AbstractUserAuth
java.lang.Exception
protected boolean processAuthDataRequest(ClientSession session, java.lang.String service, Buffer buffer) throws java.lang.Exception
processAuthDataRequest
in class AbstractUserAuth
java.lang.Exception
protected java.lang.String getExchangeLanguageTag(ClientSession session)
protected java.lang.String getExchangeSubMethods(ClientSession session)
protected java.lang.String getCurrentPasswordCandidate()
protected boolean verifyTrialsCount(ClientSession session, java.lang.String service, int cmd, int nbTrials, int maxAllowed)
protected java.lang.String[] getUserResponses(java.lang.String name, java.lang.String instruction, java.lang.String lang, java.lang.String[] prompt, boolean[] echo)
name
- The interaction name - may be emptyinstruction
- The instruction - may be emptylang
- The language tag - may be emptyprompt
- The prompts - may be emptyecho
- Whether to echo the response for the prompt or not - same
length as the promptsnull
then the assumption
is that some internal error occurred and no response is sent. Note:
according to RFC4256
the number of responses should be exactly the same as the number
of prompts. However, since it is the server's responsibility to
enforce this we do not validate the response (other than logging it as
a warning...)protected boolean useCurrentPassword(java.lang.String password, java.lang.String name, java.lang.String instruction, java.lang.String lang, java.lang.String[] prompt, boolean[] echo)
public static java.lang.String getAuthCommandName(int cmd)