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 |
logBY_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(ClientSession session,
java.lang.String password,
java.lang.String name,
java.lang.String instruction,
java.lang.String lang,
java.lang.String[] prompt,
boolean[] echo)
Checks if we have a candidate password and exactly one prompt is requested with no echo, and the prompt
matches a configurable pattern.
|
protected boolean |
verifyTrialsCount(ClientSession session,
java.lang.String service,
int cmd,
int nbTrials,
int maxAllowed) |
destroy, getClientSession, getName, getService, getSession, process, toStringgetSimplifiedLoggerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfindByName, getNameList, getNames, ofName, removeByNamepublic 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 UserAuthinit in class AbstractUserAuthsession - The ClientSessionservice - 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 AbstractUserAuthjava.lang.Exceptionprotected boolean processAuthDataRequest(ClientSession session, java.lang.String service, Buffer buffer) throws java.lang.Exception
processAuthDataRequest in class AbstractUserAuthjava.lang.Exceptionprotected 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(ClientSession session, java.lang.String password, java.lang.String name, java.lang.String instruction, java.lang.String lang, java.lang.String[] prompt, boolean[] echo)
session - The ClientSession through which the request is receivedpassword - The current password candidate to usename - The service nameinstruction - The request instructionlang - The reported language tagprompt - The requested promptsecho - The matching prompts echo flagsINTERACTIVE_PASSWORD_PROMPT,
CHECK_INTERACTIVE_PASSWORD_DELIMpublic static java.lang.String getAuthCommandName(int cmd)