Package org.apache.sshd.common.auth
Interface UserAuthMethodFactory<S extends SessionContext,M extends UserAuthInstance<S>>
-
- Type Parameters:
S- The type ofSessionContextbeing provided to the instance creatorM- The authentication method factory type
- All Superinterfaces:
NamedResource
public interface UserAuthMethodFactory<S extends SessionContext,M extends UserAuthInstance<S>> extends NamedResource
Represents a user authentication method- Author:
- Apache MINA SSHD Project
-
-
Field Summary
Fields Modifier and Type Field Description static StringHOST_BASEDHost-based authentication methodstatic StringKB_INTERACTIVEKeyboard interactive authentication methodstatic StringPASSWORDPassword authentication method namestatic StringPUBLIC_KEYPublic key authentication method name-
Fields inherited from interface org.apache.sshd.common.NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTOR
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description McreateUserAuth(S session)static <S extends SessionContext,M extends UserAuthInstance<S>>
McreateUserAuth(S session, Collection<? extends UserAuthMethodFactory<S,M>> factories, String name)static booleanisDataIntegrityAuthenticationTransport(SessionContext session)static booleanisSecureAuthenticationTransport(SessionContext session)According to RFC 4252 - section 8:-
Methods inherited from interface org.apache.sshd.common.NamedResource
getName
-
-
-
-
Field Detail
-
PASSWORD
static final String PASSWORD
Password authentication method name- See Also:
- Constant Field Values
-
PUBLIC_KEY
static final String PUBLIC_KEY
Public key authentication method name- See Also:
- Constant Field Values
-
KB_INTERACTIVE
static final String KB_INTERACTIVE
Keyboard interactive authentication method- See Also:
- Constant Field Values
-
HOST_BASED
static final String HOST_BASED
Host-based authentication method- See Also:
- Constant Field Values
-
-
Method Detail
-
createUserAuth
M createUserAuth(S session) throws IOException
- Parameters:
session- The session for which authentication is required- Returns:
- The authenticator instance
- Throws:
IOException- If failed to create the instance
-
createUserAuth
static <S extends SessionContext,M extends UserAuthInstance<S>> M createUserAuth(S session, Collection<? extends UserAuthMethodFactory<S,M>> factories, String name) throws IOException
- Type Parameters:
S- The type ofSessionContextbeing provided to the instance creatorM- The authentication method factory type- Parameters:
session- The session through which the request is being madefactories- The available factoriesname- The requested factory name- Returns:
- The created authenticator instance -
nullif no matching factory - Throws:
IOException- If failed to create the instance
-
isSecureAuthenticationTransport
static boolean isSecureAuthenticationTransport(SessionContext session)
According to RFC 4252 - section 8:Both the server and the client should check whether the underlying transport layer provides confidentiality (i.e., if encryption is being used). If no confidentiality is provided ("none" cipher), password authentication SHOULD be disabled. If there is no confidentiality or no MAC, password change SHOULD be disabled.- Parameters:
session- TheSessionContextbeing used for authentication- Returns:
trueif the context is notnulland the ciphers have been established to anything other than "none".- See Also:
CommonModuleProperties.ALLOW_INSECURE_AUTH,SessionContext.isSecureSessionTransport(SessionContext)
-
isDataIntegrityAuthenticationTransport
static boolean isDataIntegrityAuthenticationTransport(SessionContext session)
- Parameters:
session- TheSessionContextbeing used for authentication- Returns:
trueif the context is notnulland the MAC(s) used to verify packet integrity have been established.- See Also:
CommonModuleProperties.ALLOW_NON_INTEGRITY_AUTH,SessionContext.isDataIntegrityTransport(SessionContext)
-
-