Top Description Fields Methods
org.apache.sshd.common.auth

public Interface UserAuthMethodFactory<S extends SessionContext, M extends UserAuthInstance<S>>

extends NamedResource
Type Parameters
<S>
The type of SessionContext being provided to the instance creator
<M>
The authentication method factory type
Imports
java.io.IOException, java.util.Collection, org.apache.sshd.common.CommonModuleProperties, .NamedResource, org.apache.sshd.common.session.SessionContext

Represents a user authentication method
Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
public static final String
HOST_BASED

Host-based authentication method

public static final String
KB_INTERACTIVE

Keyboard interactive authentication method

public static final String
PASSWORD

Password authentication method name

public static final String
PUBLIC_KEY

Public key authentication method name

Inherited from org.apache.sshd.common.NamedResource:
BY_NAME_COMPARATORNAME_EXTRACTOR

Method Summary

Modifier and TypeMethod and Description
public M

Returns:

The authenticator instance
createUserAuth
(S
The session for which authentication is required
session
)

public static <
The type of SessionContext being provided to the instance creator
S extends SessionContext
,
The authentication method factory type
M extends UserAuthInstance<S>
>
M

Returns:

The created authenticator instance - null if no matching factory
createUserAuth
(S
The session through which the request is being made
session
,
Collection<? extends UserAuthMethodFactory<S, M>>
The available factories
factories
,
String
The requested factory name
name
)

public static boolean

Returns:

true if the context is not null and the MAC(s) used to verify packet integrity have been established.
isDataIntegrityAuthenticationTransport
(SessionContext
The SessionContext being used for authentication
session
)

public static boolean

Returns:

true if the context is not null and the ciphers have been established to anything other than "none".
isSecureAuthenticationTransport
(SessionContext
The SessionContext being used for authentication
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).
Inherited from org.apache.sshd.common.NamedResource:
findByNamefindFirstMatchByNamegetNamegetNameListgetNamesofNameremoveByNamesafeCompareByName

Field Detail

HOST_BASEDback to summary
public static final String HOST_BASED

Host-based authentication method

KB_INTERACTIVEback to summary
public static final String KB_INTERACTIVE

Keyboard interactive authentication method

PASSWORDback to summary
public static final String PASSWORD

Password authentication method name

PUBLIC_KEYback to summary
public static final String PUBLIC_KEY

Public key authentication method name

Method Detail

createUserAuthback to summary
public M createUserAuth(S session) throws IOException
Parameters
session:S

The session for which authentication is required

Returns:M

The authenticator instance

Exceptions
IOException:
If failed to create the instance
createUserAuthback to summary
public static <S extends SessionContext, M extends UserAuthInstance<S>> M createUserAuth(S session, Collection<? extends UserAuthMethodFactory<S, M>> factories, String name) throws IOException
Parameters
<S>
The type of SessionContext being provided to the instance creator
<M>
The authentication method factory type
session:S

The session through which the request is being made

factories:Collection<? extends UserAuthMethodFactory<S, M>>

The available factories

name:String

The requested factory name

Returns:M

The created authenticator instance - null if no matching factory

Exceptions
IOException:
If failed to create the instance
isDataIntegrityAuthenticationTransportback to summary
public static boolean isDataIntegrityAuthenticationTransport(SessionContext session)
Parameters
session:SessionContext

The SessionContext being used for authentication

Returns:boolean

true if the context is not null and the MAC(s) used to verify packet integrity have been established.

See Also
CommonModuleProperties#ALLOW_NON_INTEGRITY_AUTH, SessionContext#isDataIntegrityTransport(SessionContext)
isSecureAuthenticationTransportback to summary
public 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:SessionContext

The SessionContext being used for authentication

Returns:boolean

true if the context is not null and the ciphers have been established to anything other than "none".

See Also
CommonModuleProperties#ALLOW_INSECURE_AUTH, SessionContext#isSecureSessionTransport(SessionContext)