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
- All Known Subinterfaces:
UserAuthFactory,UserAuthFactory
- All Known Implementing Classes:
AbstractUserAuthFactory,AbstractUserAuthFactory,AbstractUserAuthMethodFactory,UserAuthGSSFactory,UserAuthHostBasedFactory,UserAuthHostBasedFactory,UserAuthKeyboardInteractiveFactory,UserAuthKeyboardInteractiveFactory,UserAuthNoneFactory,UserAuthPasswordFactory,UserAuthPasswordFactory,UserAuthPublicKeyFactory,UserAuthPublicKeyFactory
public interface UserAuthMethodFactory<S extends SessionContext,M extends UserAuthInstance<S>> extends NamedResource
Represents a user authentication method
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringHOST_BASEDHost-based authentication methodstatic java.lang.StringKB_INTERACTIVEKeyboard interactive authentication methodstatic java.lang.StringPASSWORDPassword authentication method namestatic java.lang.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, java.util.Collection<? extends UserAuthMethodFactory<S,M>> factories, java.lang.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 java.lang.String PASSWORD
Password authentication method name- See Also:
- Constant Field Values
-
PUBLIC_KEY
static final java.lang.String PUBLIC_KEY
Public key authentication method name- See Also:
- Constant Field Values
-
KB_INTERACTIVE
static final java.lang.String KB_INTERACTIVE
Keyboard interactive authentication method- See Also:
- Constant Field Values
-
HOST_BASED
static final java.lang.String HOST_BASED
Host-based authentication method- See Also:
- Constant Field Values
-
-
Method Detail
-
createUserAuth
M createUserAuth(S session) throws java.io.IOException
- Parameters:
session- The session for which authentication is required- Returns:
- The authenticator instance
- Throws:
java.io.IOException- If failed to create the instance
-
createUserAuth
static <S extends SessionContext,M extends UserAuthInstance<S>> M createUserAuth(S session, java.util.Collection<? extends UserAuthMethodFactory<S,M>> factories, java.lang.String name) throws java.io.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:
java.io.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)
-
-