Package org.apache.sshd.client
Interface ClientAuthenticationManager
-
- All Superinterfaces:
KeyIdentityProviderHolder
,UserAuthFactoriesManager<ClientSession,UserAuth,UserAuthFactory>
- All Known Subinterfaces:
ClientFactoryManager
,ClientSession
- All Known Implementing Classes:
AbstractClientSession
,ClientSessionImpl
,SshClient
public interface ClientAuthenticationManager extends UserAuthFactoriesManager<ClientSession,UserAuth,UserAuthFactory>, KeyIdentityProviderHolder
Holds information required for the client to perform authentication with the server- Author:
- Apache MINA SSHD Project
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_PASSWORD_PROMPTS
Default value forPASSWORD_PROMPTS
if none configuredstatic String
PASSWORD_PROMPTS
Specifies the number of interactive prompts before giving up.static String
PREFERRED_AUTHS
Ordered comma separated list of authentications methods.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
addPasswordIdentity(String password)
void
addPublicKeyIdentity(KeyPair key)
PasswordIdentityProvider
getPasswordIdentityProvider()
RetrievePasswordIdentityProvider
used to provide password candidatesAuthenticationIdentitiesProvider
getRegisteredIdentities()
ServerKeyVerifier
getServerKeyVerifier()
Retrieve the server key verifier to be used to check the key when connecting to an SSH server.UserInteraction
getUserInteraction()
String
removePasswordIdentity(String password)
KeyPair
removePublicKeyIdentity(KeyPair kp)
void
setPasswordIdentityProvider(PasswordIdentityProvider provider)
void
setServerKeyVerifier(ServerKeyVerifier serverKeyVerifier)
default void
setUserAuthFactoriesNames(Collection<String> names)
void
setUserInteraction(UserInteraction userInteraction)
-
Methods inherited from interface org.apache.sshd.common.keyprovider.KeyIdentityProviderHolder
getKeyIdentityProvider, setKeyIdentityProvider
-
Methods inherited from interface org.apache.sshd.common.auth.UserAuthFactoriesManager
getUserAuthFactories, getUserAuthFactoriesNameList, getUserAuthFactoriesNames, setUserAuthFactories, setUserAuthFactoriesNameList, setUserAuthFactoriesNames
-
-
-
-
Field Detail
-
PREFERRED_AUTHS
static final String PREFERRED_AUTHS
Ordered comma separated list of authentications methods. Authentications methods accepted by the server will be tried in the given order. If not configured ornull
/empty, then the session'sUserAuthFactoriesManager.getUserAuthFactories()
is used as-is- See Also:
- Constant Field Values
-
PASSWORD_PROMPTS
static final String PASSWORD_PROMPTS
Specifies the number of interactive prompts before giving up. The argument to this keyword must be an integer.- See Also:
DEFAULT_PASSWORD_PROMPTS
, Constant Field Values
-
DEFAULT_PASSWORD_PROMPTS
static final int DEFAULT_PASSWORD_PROMPTS
Default value forPASSWORD_PROMPTS
if none configured- See Also:
- Constant Field Values
-
-
Method Detail
-
getRegisteredIdentities
AuthenticationIdentitiesProvider getRegisteredIdentities()
- Returns:
- The
AuthenticationIdentitiesProvider
to be used for attempting password or public key authentication
-
getPasswordIdentityProvider
PasswordIdentityProvider getPasswordIdentityProvider()
RetrievePasswordIdentityProvider
used to provide password candidates- Returns:
- The
PasswordIdentityProvider
instance - ignored ifnull
(i.e., no passwords available). - See Also:
addPasswordIdentity(String)
-
setPasswordIdentityProvider
void setPasswordIdentityProvider(PasswordIdentityProvider provider)
-
addPasswordIdentity
void addPasswordIdentity(String password)
- Parameters:
password
- Password to be added - may not benull
/empty. Note: this password is in addition to whatever passwords are available via thePasswordIdentityProvider
(if any)
-
removePasswordIdentity
String removePasswordIdentity(String password)
- Parameters:
password
- The password to remove - ignored ifnull
/empty- Returns:
- The removed password - same one that was added via
addPasswordIdentity(String)
- ornull
if no match found
-
addPublicKeyIdentity
void addPublicKeyIdentity(KeyPair key)
- Parameters:
key
- TheKeyPair
to add - may not benull
Note: this key is in addition to whatever keys are available via theKeyIdentityProvider
(if any)
-
removePublicKeyIdentity
KeyPair removePublicKeyIdentity(KeyPair kp)
- Parameters:
kp
- TheKeyPair
to remove - ignored ifnull
- Returns:
- The removed
KeyPair
- same one that was added viaaddPublicKeyIdentity(KeyPair)
- ornull
if no match found
-
getServerKeyVerifier
ServerKeyVerifier getServerKeyVerifier()
Retrieve the server key verifier to be used to check the key when connecting to an SSH server.- Returns:
- the
ServerKeyVerifier
to use - nevernull
-
setServerKeyVerifier
void setServerKeyVerifier(ServerKeyVerifier serverKeyVerifier)
-
getUserInteraction
UserInteraction getUserInteraction()
- Returns:
- A
UserInteraction
object to communicate with the user (may benull
to indicate that no such communication is allowed)
-
setUserInteraction
void setUserInteraction(UserInteraction userInteraction)
-
setUserAuthFactoriesNames
default void setUserAuthFactoriesNames(Collection<String> names)
- Specified by:
setUserAuthFactoriesNames
in interfaceUserAuthFactoriesManager<ClientSession,UserAuth,UserAuthFactory>
-
-