public class UserAuthKeyboardInteractive extends AbstractUserAuth
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_INTERACTIVE_LANGUAGE_TAG |
static String |
DEFAULT_INTERACTIVE_SUBMETHODS |
static String |
INTERACTIVE_LANGUAGE_TAG |
static String |
INTERACTIVE_SUBMETHODS |
static String |
NAME |
logBY_NAME_COMPARATOR, NAME_EXTRACTOR| Constructor and Description |
|---|
UserAuthKeyboardInteractive() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getAuthCommandName(int cmd) |
protected String |
getCurrentPasswordCandidate() |
protected String |
getExchangeLanguageTag(ClientSession session) |
protected String |
getExchangeSubMethods(ClientSession session) |
protected String[] |
getUserResponses(String name,
String instruction,
String lang,
String[] prompt,
boolean[] echo) |
void |
init(ClientSession session,
String service) |
protected boolean |
processAuthDataRequest(ClientSession session,
String service,
Buffer buffer) |
protected boolean |
sendAuthDataRequest(ClientSession session,
String service) |
protected boolean |
useCurrentPassword(ClientSession session,
String password,
String name,
String instruction,
String 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,
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 String NAME
public static final String INTERACTIVE_LANGUAGE_TAG
public static final String DEFAULT_INTERACTIVE_LANGUAGE_TAG
public static final String INTERACTIVE_SUBMETHODS
public static final String DEFAULT_INTERACTIVE_SUBMETHODS
public void init(ClientSession session, String service) throws Exception
init in interface UserAuthinit in class AbstractUserAuthsession - The ClientSessionservice - The requesting service nameException - If failed to initialize the mechanismprotected boolean sendAuthDataRequest(ClientSession session, String service) throws Exception
sendAuthDataRequest in class AbstractUserAuthExceptionprotected boolean processAuthDataRequest(ClientSession session, String service, Buffer buffer) throws Exception
processAuthDataRequest in class AbstractUserAuthExceptionprotected String getExchangeLanguageTag(ClientSession session)
protected String getExchangeSubMethods(ClientSession session)
protected String getCurrentPasswordCandidate()
protected boolean verifyTrialsCount(ClientSession session, String service, int cmd, int nbTrials, int maxAllowed)
protected String[] getUserResponses(String name, String instruction, String 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, String password, String name, String instruction, String 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 String getAuthCommandName(int cmd)
Copyright © 2008–2020 The Apache Software Foundation. All rights reserved.