public class UserAuthKeyboardInteractive extends AbstractUserAuth
Modifier and Type | Field and Description |
---|---|
static String |
NAME |
log
BY_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, toString
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
signalAuthMethodFailure, signalAuthMethodSuccess
findByName, findFirstMatchByName, getNameList, getNames, ofName, removeByName, safeCompareByName
public static final String NAME
public void init(ClientSession session, String service) throws Exception
init
in interface UserAuth
init
in class AbstractUserAuth
session
- The ClientSession
service
- The requesting service nameException
- If failed to initialize the mechanismprotected boolean sendAuthDataRequest(ClientSession session, String service) throws Exception
sendAuthDataRequest
in class AbstractUserAuth
Exception
protected boolean processAuthDataRequest(ClientSession session, String service, Buffer buffer) throws Exception
processAuthDataRequest
in class AbstractUserAuth
Exception
protected 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_DELIM
public static String getAuthCommandName(int cmd)
Copyright © 2008–2024 The Apache Software Foundation. All rights reserved.