Class CachingPublicKeyAuthenticator
java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.server.auth.pubkey.CachingPublicKeyAuthenticator
- All Implemented Interfaces:
PublickeyAuthenticator
public class CachingPublicKeyAuthenticator
extends AbstractLoggingBean
implements PublickeyAuthenticator
Caches the result per session - compensates for
OpenSSH
behavior where it sends 2 requests with the same key
(see SSHD-300
).- Author:
- Apache MINA SSHD Project
-
Field Summary
Modifier and TypeFieldDescriptionprotected final PublickeyAuthenticator
static final AttributeRepository.AttributeKey<Map<PublicKey,
Boolean>> TheAttributeKey
used to store the cached authentication results on the session instanceFields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
authenticate
(String username, PublicKey key, ServerSession session) Check the validity of a public key.resolveCachedResults
(String username, PublicKey key, ServerSession session)
-
Field Details
-
CACHE_ATTRIBUTE
TheAttributeKey
used to store the cached authentication results on the session instance -
authenticator
-
-
Constructor Details
-
CachingPublicKeyAuthenticator
-
-
Method Details
-
authenticate
Description copied from interface:PublickeyAuthenticator
Check the validity of a public key.- Specified by:
authenticate
in interfacePublickeyAuthenticator
- Parameters:
username
- the usernamekey
- the keysession
- the server session- Returns:
- a boolean indicating if authentication succeeded or not
-
resolveCachedResults
-