Package org.apache.sshd.server
Interface ServerAuthenticationManager
-
- All Superinterfaces:
KeyPairProviderHolder,UserAuthFactoriesManager<ServerSession,UserAuth,UserAuthFactory>
- All Known Subinterfaces:
ServerFactoryManager,ServerSession
- All Known Implementing Classes:
AbstractServerSession,ServerSessionImpl,SshServer
public interface ServerAuthenticationManager extends UserAuthFactoriesManager<ServerSession,UserAuth,UserAuthFactory>, KeyPairProviderHolder
Holds providers and helpers related to the server side authentication process
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringAUTH_METHODSThis key is used when configuring multi-step authentications.static java.lang.StringAUTO_WELCOME_BANNER_VALUESpecial value that can be set for theWELCOME_BANNERproperty indicating that the server should generate a banner consisting of the random art of the server's keys (if any are provided).static WelcomeBannerPhaseDEFAULT_BANNER_PHASEDefault value forWELCOME_BANNER_PHASEif none specifiedstatic intDEFAULT_MAX_AUTH_REQUESTSDefault value forMAX_AUTH_REQUESTSif none configuredstatic UserAuthGSSFactoryDEFAULT_USER_AUTH_GSS_FACTORYstatic UserAuthKeyboardInteractiveFactoryDEFAULT_USER_AUTH_KB_INTERACTIVE_FACTORYstatic UserAuthPasswordFactoryDEFAULT_USER_AUTH_PASSWORD_FACTORYstatic UserAuthPublicKeyFactoryDEFAULT_USER_AUTH_PUBLIC_KEY_FACTORYstatic java.lang.StringDEFAULT_WELCOME_BANNER_LANGUAGEDefault value forWELCOME_BANNER_LANGUAGEis not overwrittenstatic java.lang.StringMAX_AUTH_REQUESTSKey used to retrieve the value in the configuration properties map of the maximum number of failed authentication requests before the server closes the connection.static java.lang.StringWELCOME_BANNERKey used to retrieve the value of welcome banner that will be displayed when a user connects to the server.static java.lang.StringWELCOME_BANNER_CHARSETThe charset to use if the configured welcome banner points to a file - if not specified (either as a string or aCharsetthen the local default is used.static java.lang.StringWELCOME_BANNER_LANGUAGEKey used to denote the language code for the welcome banner (if such a banner is configured).static java.lang.StringWELCOME_BANNER_PHASETheWelcomeBannerPhasevalue - either as an enum or a string
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description GSSAuthenticatorgetGSSAuthenticator()Retrieve theGSSAuthenticatorto be used by the SSH server.HostBasedAuthenticatorgetHostBasedAuthenticator()Retrieve theHostBasedAuthenticatorto be used by the SSH server.KeyboardInteractiveAuthenticatorgetKeyboardInteractiveAuthenticator()Retrieve theKeyboardInteractiveAuthenticatorto be used by the SSH server.PasswordAuthenticatorgetPasswordAuthenticator()Retrieve thePasswordAuthenticatorto be used by the SSH server.PublickeyAuthenticatorgetPublickeyAuthenticator()Retrieve thePublickeyAuthenticatorto be used by SSH server.static java.util.List<UserAuthFactory>resolveUserAuthFactories(ServerAuthenticationManager manager)If user authentication factories already set, then simply returns them.static java.util.List<UserAuthFactory>resolveUserAuthFactories(ServerAuthenticationManager manager, java.util.List<UserAuthFactory> userFactories)If user authentication factories already set, then simply returns them.voidsetGSSAuthenticator(GSSAuthenticator gssAuthenticator)voidsetHostBasedAuthenticator(HostBasedAuthenticator hostBasedAuthenticator)voidsetKeyboardInteractiveAuthenticator(KeyboardInteractiveAuthenticator interactiveAuthenticator)voidsetPasswordAuthenticator(PasswordAuthenticator passwordAuthenticator)voidsetPublickeyAuthenticator(PublickeyAuthenticator publickeyAuthenticator)default voidsetUserAuthFactoriesNames(java.util.Collection<java.lang.String> names)-
Methods inherited from interface org.apache.sshd.common.keyprovider.KeyPairProviderHolder
getKeyPairProvider, setKeyPairProvider
-
Methods inherited from interface org.apache.sshd.common.auth.UserAuthFactoriesManager
getUserAuthFactories, getUserAuthFactoriesNameList, getUserAuthFactoriesNames, setUserAuthFactories, setUserAuthFactoriesNameList, setUserAuthFactoriesNames
-
-
-
-
Field Detail
-
MAX_AUTH_REQUESTS
static final java.lang.String MAX_AUTH_REQUESTS
Key used to retrieve the value in the configuration properties map of the maximum number of failed authentication requests before the server closes the connection.- See Also:
DEFAULT_MAX_AUTH_REQUESTS, Constant Field Values
-
DEFAULT_MAX_AUTH_REQUESTS
static final int DEFAULT_MAX_AUTH_REQUESTS
Default value forMAX_AUTH_REQUESTSif none configured- See Also:
- Constant Field Values
-
WELCOME_BANNER
static final java.lang.String WELCOME_BANNER
Key used to retrieve the value of welcome banner that will be displayed when a user connects to the server. Ifnull/empty then no banner will be sent. The value can be one of the following:-
A
FileorPath, in which case its contents will be transmitted. Note: if the file is empty or does not exits, no banner will be transmitted. -
A
URIor a string starting with "file:/", in which case it will be converted to aPathand handled accordingly. -
A string containing a special value indicator - e.g.,
AUTO_WELCOME_BANNER_VALUE, in which case the relevant banner content will be generated. -
Any other object whose
toString()value yields a non empty string will be used as the banner contents.
- See Also:
- RFC-4252 section 5.4, Constant Field Values
-
A
-
AUTO_WELCOME_BANNER_VALUE
static final java.lang.String AUTO_WELCOME_BANNER_VALUE
Special value that can be set for theWELCOME_BANNERproperty indicating that the server should generate a banner consisting of the random art of the server's keys (if any are provided). If no server keys are available, then no banner will be sent- See Also:
- Constant Field Values
-
WELCOME_BANNER_LANGUAGE
static final java.lang.String WELCOME_BANNER_LANGUAGE
Key used to denote the language code for the welcome banner (if such a banner is configured). If not set, thenDEFAULT_WELCOME_BANNER_LANGUAGEis used- See Also:
- Constant Field Values
-
DEFAULT_WELCOME_BANNER_LANGUAGE
static final java.lang.String DEFAULT_WELCOME_BANNER_LANGUAGE
Default value forWELCOME_BANNER_LANGUAGEis not overwritten- See Also:
- Constant Field Values
-
WELCOME_BANNER_PHASE
static final java.lang.String WELCOME_BANNER_PHASE
TheWelcomeBannerPhasevalue - either as an enum or a string- See Also:
- Constant Field Values
-
DEFAULT_BANNER_PHASE
static final WelcomeBannerPhase DEFAULT_BANNER_PHASE
Default value forWELCOME_BANNER_PHASEif none specified
-
WELCOME_BANNER_CHARSET
static final java.lang.String WELCOME_BANNER_CHARSET
The charset to use if the configured welcome banner points to a file - if not specified (either as a string or aCharsetthen the local default is used.- See Also:
- Constant Field Values
-
AUTH_METHODS
static final java.lang.String AUTH_METHODS
This key is used when configuring multi-step authentications. The value needs to be a blank separated list of comma separated list of authentication method names. For example, an argument ofpublickey,password publickey,keyboard-interactivewould require the user to complete public key authentication, followed by either password or keyboard interactive authentication. Only methods that are next in one or more lists are offered at each stage, so for this example, it would not be possible to attempt password or keyboard-interactive authentication before public key.- See Also:
- Constant Field Values
-
DEFAULT_USER_AUTH_PUBLIC_KEY_FACTORY
static final UserAuthPublicKeyFactory DEFAULT_USER_AUTH_PUBLIC_KEY_FACTORY
-
DEFAULT_USER_AUTH_GSS_FACTORY
static final UserAuthGSSFactory DEFAULT_USER_AUTH_GSS_FACTORY
-
DEFAULT_USER_AUTH_PASSWORD_FACTORY
static final UserAuthPasswordFactory DEFAULT_USER_AUTH_PASSWORD_FACTORY
-
DEFAULT_USER_AUTH_KB_INTERACTIVE_FACTORY
static final UserAuthKeyboardInteractiveFactory DEFAULT_USER_AUTH_KB_INTERACTIVE_FACTORY
-
-
Method Detail
-
setUserAuthFactoriesNames
default void setUserAuthFactoriesNames(java.util.Collection<java.lang.String> names)
- Specified by:
setUserAuthFactoriesNamesin interfaceUserAuthFactoriesManager<ServerSession,UserAuth,UserAuthFactory>
-
getPublickeyAuthenticator
PublickeyAuthenticator getPublickeyAuthenticator()
Retrieve thePublickeyAuthenticatorto be used by SSH server. If no authenticator has been configured (i.e. this method returnsnull), then client authentication requests based on keys will be rejected.- Returns:
- the
PublickeyAuthenticatorornull
-
setPasswordAuthenticator
void setPasswordAuthenticator(PasswordAuthenticator passwordAuthenticator)
-
getPasswordAuthenticator
PasswordAuthenticator getPasswordAuthenticator()
Retrieve thePasswordAuthenticatorto be used by the SSH server. If no authenticator has been configured (i.e. this method returnsnull), then client authentication requests based on passwords will be rejected.- Returns:
- the
PasswordAuthenticatorornull
-
setPublickeyAuthenticator
void setPublickeyAuthenticator(PublickeyAuthenticator publickeyAuthenticator)
-
getKeyboardInteractiveAuthenticator
KeyboardInteractiveAuthenticator getKeyboardInteractiveAuthenticator()
Retrieve theKeyboardInteractiveAuthenticatorto be used by the SSH server. If no authenticator has been configured (i.e. this method returnsnull), then client authentication requests based on this method will be rejected.- Returns:
- The
KeyboardInteractiveAuthenticatorornull
-
setKeyboardInteractiveAuthenticator
void setKeyboardInteractiveAuthenticator(KeyboardInteractiveAuthenticator interactiveAuthenticator)
-
getGSSAuthenticator
GSSAuthenticator getGSSAuthenticator()
Retrieve theGSSAuthenticatorto be used by the SSH server. If no authenticator has been configured (i.e. this method returnsnull), then client authentication requests based on gssapi will be rejected.- Returns:
- the
GSSAuthenticatorornull
-
setGSSAuthenticator
void setGSSAuthenticator(GSSAuthenticator gssAuthenticator)
-
getHostBasedAuthenticator
HostBasedAuthenticator getHostBasedAuthenticator()
Retrieve theHostBasedAuthenticatorto be used by the SSH server. If no authenticator has been configured (i.e. this method returnsnull), then client authentication requests based on this method will be rejected.- Returns:
- the
HostBasedAuthenticatorornull
-
setHostBasedAuthenticator
void setHostBasedAuthenticator(HostBasedAuthenticator hostBasedAuthenticator)
-
resolveUserAuthFactories
static java.util.List<UserAuthFactory> resolveUserAuthFactories(ServerAuthenticationManager manager)
If user authentication factories already set, then simply returns them. Otherwise, builds the factories list from the individual authenticators available for the manager - password public key, keyboard-interactive, GSS, etc...- Parameters:
manager- TheServerAuthenticationManager- ignored ifnull- Returns:
- The resolved
ListofNamedFactoryfor theUserAuths - See Also:
resolveUserAuthFactories(ServerAuthenticationManager, List)
-
resolveUserAuthFactories
static java.util.List<UserAuthFactory> resolveUserAuthFactories(ServerAuthenticationManager manager, java.util.List<UserAuthFactory> userFactories)
If user authentication factories already set, then simply returns them. Otherwise, builds the factories list from the individual authenticators available for the manager - password public key, keyboard-interactive, GSS, etc...- Parameters:
manager- TheServerAuthenticationManager- ignored ifnulluserFactories- The currently availableUserAuthfactories - if notnull/empty then they are used as-is.- Returns:
- The resolved
ListofNamedFactoryfor theUserAuths
-
-